/* ===== You Hyunjin Portfolio ===== */
:root {
  --bg: #141414;
  --bg2: #1b1b1b;
  --ink: #ece9e2;
  --ink-dim: #9a968c;
  --hair: rgba(236, 233, 226, 0.14);
  --accent: #d8d3c6;
  --serif: "Playfair Display", "Noto Sans KR", serif;
  --sans: "Noto Sans KR", -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}
/* film grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.06'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ===== nav ===== */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px;
  mix-blend-mode: difference;
}
#nav .brand { font-family: var(--serif); font-style: italic; font-size: 22px; letter-spacing: 0.05em; }
#nav .links a {
  margin-left: 28px; font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase;
  opacity: 0.75; transition: opacity 0.25s;
}
#nav .links a:hover { opacity: 1; }

/* ===== hero (표지) ===== */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 90px 4vw 70px;
  position: relative;
  background: radial-gradient(ellipse 90% 60% at 50% 110%, #1d1c1a 0%, var(--bg) 60%);
}
.hero-cover {
  max-width: min(1280px, 92vw);
  max-height: calc(100vh - 170px);
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}
.hero-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; letter-spacing: 0.2em; color: var(--ink-dim);
  margin-bottom: 4vh;
}
.pill { border: 1px solid var(--hair); border-radius: 999px; padding: 3px 16px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(72px, 15vw, 220px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: 0.01em;
}
.script { font-family: "Italiana", var(--serif); font-style: normal; font-weight: 400; }
.outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  font-style: italic; font-weight: 400;
}
.hero-sub {
  margin-top: 5vh; font-size: 14px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent);
}
.hero-desc { margin-top: 18px; color: var(--ink-dim); font-size: 15px; }
.hero-tags { margin-top: 4vh; display: flex; flex-wrap: wrap; gap: 10px; max-width: 720px; }
.hero-tags span {
  font-size: 12px; letter-spacing: 0.12em; color: var(--ink-dim);
  border: 1px solid var(--hair); border-radius: 999px; padding: 5px 16px;
}
.scroll-hint {
  position: absolute; bottom: 36px; right: 6vw;
  font-size: 10px; letter-spacing: 0.4em; color: var(--ink-dim);
  display: flex; align-items: center; gap: 12px;
}
.scroll-hint .line { width: 64px; height: 1px; background: var(--ink-dim); display: inline-block; }

/* ===== about ===== */
.about-lead { max-width: 860px; }
.about-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(32px, 4.6vw, 60px); line-height: 1.28; letter-spacing: 0.01em;
}
.about-sub { margin-top: 26px; font-size: 16px; font-weight: 400; color: var(--accent); }
.about-body { margin-top: 16px; font-size: 15px; color: var(--ink-dim); max-width: 720px; }
.about-grid {
  margin-top: 90px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px;
}
.about-label {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--hair); padding-bottom: 12px; margin-bottom: 22px;
}
.info-list div { display: flex; flex-direction: column; margin-bottom: 20px; }
.info-list dt { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-dim); }
.info-list dd { font-size: 14.5px; margin-top: 2px; word-break: break-all; }
.info-list a { border-bottom: 1px solid var(--hair); transition: border-color 0.2s; }
.info-list a:hover { border-color: var(--accent); }
.tl { list-style: none; }
.tl li { margin-bottom: 24px; }
.tl.compact li { margin-bottom: 16px; }
.tl-date { display: block; font-size: 11.5px; letter-spacing: 0.15em; color: var(--ink-dim); margin-bottom: 2px; }
.tl li strong { display: block; font-weight: 500; font-size: 14.5px; }
.tl-role { display: block; font-size: 13px; color: var(--ink-dim); }

/* ===== sections ===== */
.section { padding: 140px 6vw 60px; }
.section-head { margin-bottom: 70px; border-bottom: 1px solid var(--hair); padding-bottom: 32px; position: relative; }
.sec-no {
  position: absolute; right: 0; bottom: 32px;
  font-family: var(--serif); font-style: italic;
  font-size: 15px; color: var(--ink-dim); letter-spacing: 0.2em;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(48px, 7vw, 96px); line-height: 1;
}
.section-head h2 em { font-family: "Italiana", var(--serif); font-style: normal; }
.section-head p { color: var(--ink-dim); font-size: 13px; letter-spacing: 0.15em; margin-top: 12px; }

.sub-head { margin: 24px 0 28px; }
.sub-head h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: 0.02em; }
.sub-head p { color: var(--ink-dim); font-size: 13px; margin-top: 4px; }
.sub-head .ba-note { color: #cf9a8f; font-size: 12.5px; margin-top: 10px; letter-spacing: 0.02em; }

/* project block */
.project { margin-bottom: 110px; content-visibility: auto; contain-intrinsic-size: auto 1200px; }
.project-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 8px; flex-wrap: wrap; }
.project-head h3 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 40px); letter-spacing: 0.02em;
}
.project-head .artist { font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ink-dim); }
.project-desc { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 26px; max-width: 640px; }
.project-note {
  color: var(--ink-dim); font-size: 13.5px; line-height: 1.9;
  margin: -10px 0 30px; max-width: 760px;
  border-left: 2px solid var(--hair); padding-left: 18px;
}
.post-link {
  font-size: 11.5px; letter-spacing: 0.18em; text-transform: none;
  border: 1px solid var(--hair); border-radius: 999px; padding: 5px 16px;
  color: var(--accent); transition: background 0.2s, border-color 0.2s;
}
.post-link:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--accent); }
.subgroup-label {
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-dim);
  margin: 34px 0 14px; display: flex; align-items: center; gap: 14px;
}
.subgroup-label::after { content: ""; flex: 1; height: 1px; background: var(--hair); }

/* ===== masonry ===== */
.masonry { column-gap: 18px; }
.masonry.cols-2 { column-count: 2; max-width: 820px; }
.masonry.cols-3 { column-count: 3; }
.masonry.cols-4 { column-count: 4; }
.tile {
  break-inside: avoid; margin-bottom: 18px; position: relative;
  cursor: zoom-in; overflow: hidden; background: var(--bg2);
  border-radius: 3px;
}
.tile { content-visibility: auto; contain-intrinsic-size: auto 320px; }
.tile img { width: 100%; transition: transform 0.5s ease, opacity 0.5s; opacity: 0; }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.025); }
.tile.tall img { max-height: 560px; object-fit: cover; object-position: top; }
.tile .badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; letter-spacing: 0.2em; padding: 3px 10px;
  background: rgba(0,0,0,0.55); border: 1px solid var(--hair); border-radius: 999px;
  color: var(--ink); backdrop-filter: blur(4px);
}
.tile .link-badge { top: auto; bottom: 10px; right: 10px; color: var(--accent); }

/* ===== before / after ===== */
.ba-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 22px; margin-bottom: 90px;
}
.ba {
  position: relative; overflow: hidden; border-radius: 3px; background: var(--bg2);
  user-select: none; touch-action: none;
}
.ba img { width: 100%; pointer-events: none; }
.ba .after-wrap {
  position: absolute; inset: 0;
  clip-path: inset(0 50% 0 0);
}
.ba .after-wrap img { width: 100%; height: 100%; object-fit: cover; }
.ba .divider {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: #fff; cursor: ew-resize;
}
.ba .divider::after {
  content: "◂ ▸"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff; color: #111; font-size: 10px; letter-spacing: 1px;
  border-radius: 999px; padding: 6px 10px; white-space: nowrap;
}
.ba .tag { position: absolute; bottom: 12px; font-size: 10px; letter-spacing: 0.25em; padding: 4px 12px; background: rgba(0,0,0,0.55); border-radius: 999px; backdrop-filter: blur(4px); }
.ba .tag.before { right: 12px; }
.ba .tag.after { left: 12px; }

/* ===== video ===== */
.video-wrap { border: 1px solid var(--hair); border-radius: 4px; overflow: hidden; background: #000; }
.video-wrap video { width: 100%; display: block; max-height: 80vh; }
.video-wrap.yt { aspect-ratio: 16 / 9; }
.video-wrap.yt iframe { width: 100%; height: 100%; display: block; border: 0; }
.video-missing { padding: 80px 20px; text-align: center; color: var(--ink-dim); font-size: 14px; letter-spacing: 0.05em; }

/* ===== footer ===== */
footer { padding: 160px 6vw 90px; text-align: center; }
.foot-mark { font-family: var(--serif); font-size: clamp(48px, 8vw, 110px); font-weight: 600; line-height: 1; }
footer p { color: var(--ink-dim); font-size: 12px; letter-spacing: 0.3em; margin-top: 24px; text-transform: uppercase; }

/* ===== lightbox ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 10, 10, 0.96);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-stage { max-width: 92vw; max-height: 88vh; overflow: auto; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.lb-stage img { max-width: 90vw; margin: 0 auto; }
.lb-stage img.fit { max-height: 86vh; object-fit: contain; }
.lb-caption {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-size: 12px; letter-spacing: 0.1em; color: var(--ink-dim);
}
.lb-linkbar {
  position: fixed; bottom: 48px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  background: rgba(0, 0, 0, 0.7); border: 1px solid var(--hair); border-radius: 999px;
  padding: 9px 22px; backdrop-filter: blur(6px);
  font-size: 13px; letter-spacing: 0.05em; white-space: nowrap;
}
.lb-linkbar[hidden] { display: none; }
.lb-linkbar a { color: var(--accent); }
.lb-linkbar a:hover { text-decoration: underline; }
.lb-linkbar a.blocked { color: #e8b9ae; }
.lb-linkbar .count { color: var(--ink-dim); font-size: 11.5px; }
.lb-close, .lb-prev, .lb-next {
  position: fixed; z-index: 1001;
  background: none; border: 1px solid var(--hair); color: var(--ink);
  width: 48px; height: 48px; border-radius: 50%;
  font-size: 22px; cursor: pointer; transition: background 0.2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.1); }
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.on { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .masonry.cols-4 { column-count: 3; }
}
@media (max-width: 1100px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  #nav { padding: 16px 20px; }
  .section { padding: 100px 5vw 40px; }
  .masonry.cols-3, .masonry.cols-4 { column-count: 2; }
  .ba-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 520px) {
  .masonry.cols-3, .masonry.cols-4 { column-count: 1; }
}
