/* =========================================================
   DEMOOD SEOUL — site3
   site1의 페이지 구조(Intro → Main → Brand / Works / Contact)와 전환 모션 +
   site2의 비주얼 언어(페이퍼 배경, 보이는 정사각 그리드, 코발트 블록, 모노 라벨)

   Color
   Paper   #F3F1EC  배경
   Ink     #111111  글자 · 굵은 선 · 버튼
   Mute    #5C5B56  보조 텍스트 (paper 대비 6.3:1)
   Surface #E4E2DB  이미지 플레이스홀더
   Cobalt  #2F55D4  유일한 포인트 — 수레국화 블루 (white 대비 6.2:1)
   ========================================================= */
:root {
  --paper: #F3F1EC;
  --ink: #111111;
  --mute: #5C5B56;
  --surface: #E4E2DB;
  --cobalt: #2F55D4;
  --line: rgba(17, 17, 17, .09);

  /* Typography (모두 SIL OFL 1.1 — 상업적 사용 무료)
     Display  Instrument Serif  워드마크·제목·꽃 이름. 좁고 날카로운 하이콘트라스트 세리프 (Regular/Italic만 존재)
     UI/Text  Geist             메뉴·버튼·영문 본문. 감정을 빼고 세리프를 받쳐주는 동시대 그로테스크
     Meta     Geist Mono        라벨·캡션만. 그리드의 기술적인 결 유지
     Korean   Pretendard        한글 전부. Geist와 x-height·획 두께가 맞음
     원칙: 세리프는 크게, 산세리프는 작고 조용하게. 넓은 자간 대문자는 모노 라벨에만. */
  --serif: "Instrument Serif", "Pretendard Variable", Pretendard, Georgia, serif;
  --kr: "Geist", "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --ui: "Geist", "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;

  --fs-h1: clamp(44px, 6.5vw, 104px);
  --gutter: 16px;
  --cols: 12;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
@media (max-width: 760px) { :root { --cols: 6; } }

/* body는 컨테이너 — 자식들이 100cqw로 정확한 정사각 셀을 계산 */
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { container-type: inline-size; }
body > * { --cell: calc(100cqw / var(--cols)); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.7 var(--kr);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  word-break: keep-all;
  overflow-x: hidden;
}
.js body { opacity: 0; transition: opacity .5s ease; }
.js body.is-loaded { opacity: 1; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: inherit; text-wrap: balance; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- Shared type / parts ---------- */
.mono { font-family: var(--mono); font-size: 10.5px; font-weight: 400; line-height: 1.5; letter-spacing: .04em; text-transform: uppercase; }
.label { display: block; font: 400 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 4.6vw, 72px); line-height: .95; letter-spacing: -.02em; }
.h2 em, .page__title em { font-style: italic; }
.h3 { font-family: var(--ui); font-weight: 500; font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }
.accent { color: var(--cobalt); }
.pill {
  display: inline-block; font: 400 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 99px; padding: 6px 11px 5px;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  font: 500 13px/1 var(--ui); letter-spacing: -.005em; padding: 13px 18px; border-radius: 99px;
  transition: background .3s;
}
.btn:hover { background: var(--cobalt); }

/* 보이는 정사각 그리드 */
.grid-bg {
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
}

/* ---------- 1. Intro ---------- */
.intro {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 24px var(--gutter);
}
.intro__photo { display: block; overflow: hidden; }
.intro__photo img {
  width: auto; max-height: min(38vh, 340px); max-width: 60vw; /* crop 없음 */
  filter: grayscale(1) contrast(1.05);
  transition: filter 1s var(--ease), transform 1.2s var(--ease);
}
/* 마우스 올리면 흑백 → 원본 컬러 (터치 기기는 누르는 순간) */
.intro__photo:hover img,
.intro__photo:focus-visible img,
.intro__photo:active img { filter: none; transform: scale(1.03); }
.intro__name { font: 400 28px/1 var(--serif); letter-spacing: -.01em; }
.intro__hint { color: var(--mute); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--gutter);
  font: 400 13px/1 var(--ui); letter-spacing: -.005em;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar__brand { font: 400 20px/1 var(--serif); letter-spacing: -.01em; }
.topbar__nav { display: flex; gap: 24px; }
.topbar a { transition: color .2s; }
.topbar a:hover { color: var(--cobalt); }
.topbar__nav a[aria-current="page"] {
  text-decoration: underline; text-underline-offset: 5px;
  text-decoration-thickness: 1.5px; text-decoration-color: var(--cobalt);
}

/* ---------- 2. Main: wordmark ---------- */
.home {
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) var(--gutter);
}
.home__wordmark {
  width: max-content;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 12vw;
  line-height: .8;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.home__wordmark .char {
  display: inline-block;
  transform: translateY(40%); opacity: 0;
  transition: transform 1.2s var(--ease), opacity 1.2s var(--ease);
  transition-delay: calc(var(--i) * 50ms + 150ms);
}
.is-loaded .home__wordmark .char { transform: none; opacity: 1; }

/* ---------- 2-b. Main: editorial (site2) ---------- */
.edit {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr);
  padding: var(--cell) 0;
}
.edit__intro { grid-column: 1 / 5; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding: 0 var(--gutter); }
.edit__intro .h2 { max-width: 11ch; }
.edit__foot { margin-top: auto; padding-top: 40px; font-size: 13.5px; color: var(--mute); max-width: 34ch; }
.edit__foot-h { font: italic 400 22px/1.2 var(--serif); color: var(--ink); margin-bottom: 6px; }

.edit__img { grid-column: 5 / 10; position: relative; align-self: start; }
.edit__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.edit__block {
  position: absolute; z-index: 1; left: 0; top: 12%; width: 42%; height: 58%;
  background: var(--cobalt); mix-blend-mode: multiply;
  transition: width .9s var(--ease), height .9s var(--ease);
}
.edit__img:hover .edit__block { width: 54%; height: 66%; }
.edit__img figcaption { margin-top: 10px; color: var(--mute); }


/* ---------- Sub pages ---------- */
.page { padding: clamp(120px, 18vh, 200px) var(--gutter) 80px; min-height: 100svh; }
.page__title {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: calc(var(--fs-h1) * 1.1);
  font-weight: 400; line-height: .9; letter-spacing: -0.03em;
}
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 48px;
}
.count { font: italic 400 clamp(28px, 2.6vw, 40px)/1 var(--serif); color: var(--cobalt); }

/* Placeholders / image frames */
.ph {
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface);
  color: var(--mute);
  font: 400 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em;
}
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph--card { aspect-ratio: 3 / 4; }
.ph--portrait { aspect-ratio: 1206 / 1579; }

/* 코발트 듀오톤: 흑백 사진을 코발트 위에 곱하기 → 호버 시 원본 컬러 */
.ph--duotone { background: var(--cobalt); }
.ph--duotone img {
  filter: grayscale(1) contrast(1.05) brightness(1.35);
  mix-blend-mode: multiply;
  transition: filter .8s var(--ease);
}
.ph--duotone:hover img { filter: none; mix-blend-mode: normal; }

/* Works grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.card__body {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 0 10px; border-bottom: 1px solid rgba(17,17,17,.2);
}
.card__title { font: 400 clamp(24px, 2vw, 30px)/1.05 var(--serif); letter-spacing: -.01em; transition: color .3s; }
.card__date { flex: none; color: var(--mute); font-variant-numeric: tabular-nums; }
/* 흑백 → 마우스 올리면 원본 컬러 (첫 화면과 동일) */
.ph--photo img {
  object-position: 50% 40%;
  filter: grayscale(1) contrast(1.05);
  transition: filter 1s var(--ease), transform 1.2s var(--ease);
}
.card:hover .ph--photo img,
.card:focus-visible .ph--photo img,
.card:active .ph--photo img { filter: none; transform: scale(1.03); }
.card:hover .card__title { color: var(--cobalt); }

/* Brand */
.about__top, .about__body { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.about__lead { max-width: 34em; padding-top: 28px; font: 500 clamp(17px, 1.4vw, 20px)/1.65 var(--kr); letter-spacing: -0.02em; }
.about hr { border: 0; border-top: 1.5px solid var(--ink); margin: 72px 0 24px; }
.about figure { max-width: 440px; }
.about figcaption { display: flex; justify-content: space-between; margin-top: 10px; color: var(--mute); }
.about__text { max-width: 30em; display: grid; gap: 16px; align-content: start; }
.about__text h2 { font: 600 clamp(19px, 1.7vw, 24px)/1.45 var(--kr); letter-spacing: -0.03em; margin-bottom: 8px; }
.about__text p { line-height: 1.8; color: var(--mute); }

/* Contact */
.contact { display: flex; flex-direction: column; }
.contact__cta {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(42px, 6.6vw, 108px);
  font-weight: 400; line-height: .95; letter-spacing: -0.03em;
}
.contact__cta em { font-style: italic; color: var(--cobalt); }
.contact__mail { align-self: flex-start; margin-top: 36px; }
.contact__cols {
  display: grid; grid-template-columns: 1fr 1fr 2fr;
  margin-top: clamp(96px, 20vh, 200px);
  border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink);
  font-size: 14.5px; line-height: 1.7;
}
.contact__cols > div { padding: 14px 16px 28px; border-right: 1px solid var(--ink); }
.contact__cols > div:last-child { border-right: 0; }
.contact__cols .label { margin-bottom: 10px; }
.contact__cols a:hover { color: var(--cobalt); }
.contact__year { text-align: right; color: var(--mute); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal-img {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal-img.is-in { clip-path: inset(0 0 0 0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) and (min-width: 761px) {
  .edit__intro { grid-column: 1 / 6; }
  .edit__img { grid-column: 6 / 13; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .edit__intro, .edit__img { grid-column: 1 / -1; }
  .edit__img { margin: var(--cell) var(--gutter) 0; }
  .edit__foot { padding-top: 16px; }
}
@media (max-width: 600px) {
  .topbar__nav { gap: 12px; }
  .topbar__brand { font-size: 18px; }
  .grid { gap: 24px 16px; }
  .card__body { flex-direction: column; align-items: flex-start; gap: 4px; }
  .about__top, .about__body { grid-template-columns: 1fr; }
  .about__body { gap: 40px; }
  .contact__cols { grid-template-columns: 1fr 1fr; }
  .contact__cols > div:nth-child(2) { border-right: 0; }
  .contact__cols > div:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .contact__year { grid-column: 1 / -1; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  body, .home__wordmark .char, .reveal, .reveal-img {
    opacity: 1 !important; transform: none !important;
    clip-path: none !important; transition: none !important;
  }
  *, *::before, *::after { transition-duration: 0s !important; }
}
