/* ==========================================================
   Yeo Baek(여백) — 공통 스타일
   index.html과 앞으로 만들 works/작품ID.html이 함께 쓴다.
   페이지 전용 스타일은 home.css처럼 따로 둔다.
   ========================================================== */

:root {
  /* 색: 흰 바탕 + 진한 먹색 */
  --paper: #ffffff;
  --ink: #1b1b1b;
  --ink-soft: #6e6a62;
  --accent: #7a4e33;       /* 강조색: 그림 속 마룻바닥 고동색 (2026-10-04, 이전 빨강 #ce1831) */
  --ink-faint: #d9d9d9;    /* 흐린 글자 (흘러가는 단어 줄) */
  --line: #1b1b1b;
  --dark: #161616;         /* 꼬리말 바탕 */

  /* 글꼴: 한글 전체는 Pretendard, 영문 제목·로고는 Archivo */
  --font-logo: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-display: "Archivo", "Pretendard Variable", Pretendard, sans-serif; /* 영문 대형 제목 */
  --font-head: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  /* 간격 */
  --gutter: 32px;          /* 페이지 좌우 여백 (넉넉하게) */
  --max: 1200px;
  --header-h: 64px;
  --section-gap: clamp(160px, 20vw, 300px); /* 섹션 위아래 여백 (넉넉하게) */
}

@media (min-width: 768px) {
  :root { --gutter: clamp(64px, 11vw, 200px); --header-h: 76px; }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.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;
}

/* ---------- 레이아웃 ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 로고 ---------- */
/* 로고: 무지식 — 위에 굵은 영문, 아래 작은 고딕 한자 */
.logo-en,
.logo-sub { display: block; text-align: center; }
.logo-en {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.logo-sub {
  margin-top: 0.12em;
  font-family: "Noto Sans KR", var(--font-sans);
  font-weight: 700;
  font-size: 0.5em;
  letter-spacing: 0.3em;
  padding-left: 0.3em; /* 자간으로 생긴 오른쪽 여백 보정 */
}
.logo {
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

/* 한 줄 로고 (갤러리 수련 시안 D) */
.logo-line { font-weight: 600; letter-spacing: 0.02em; }
.logo-line b { font-weight: 800; }

/* ---------- 머리말: 가운데 로고 + 오른쪽 + 메뉴 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--paper);
  /* 처음엔 위로 숨겨 두고, 스크롤하면 내려온다 */
  transform: translateY(-100%);
  transition: transform .35s ease, box-shadow .3s;
}
.site-header.is-scrolled,
.site-header:focus-within,
.menu-open .site-header { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
.site-header .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.site-header .logo {
  color: var(--ink); /* 머리말 로고는 먹색 (2026-10-04) */
  font-size: 15px;
  opacity: 0;
  transition: opacity .4s;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.site-header.is-scrolled .logo,
.site-header:focus-within .logo,
.menu-open .site-header .logo { opacity: 1; }

.menu-btn {
  position: absolute;
  right: 14px; /* 2026-10-04 오른쪽 끝으로 (아이콘 끝이 화면에서 약 24px) */
  width: 40px;
  height: 40px;
}
.menu-btn::before, .menu-btn::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 20px; height: 1.5px; /* + 아이콘 (2026-10-04 30→20px) */
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: transform .3s;
}
.menu-btn::after { transform: translate(-50%, -50%) rotate(90deg); }
.menu-open .menu-btn::before { transform: translate(-50%, -50%) rotate(45deg); }
.menu-open .menu-btn::after  { transform: translate(-50%, -50%) rotate(135deg); }

/* 펼침 메뉴 */
.menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 49;
  background: var(--paper);
  padding: 40px var(--gutter);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.menu-open .menu { opacity: 1; visibility: visible; }
.menu ul { display: grid; gap: 8px; }
.menu a {
  font-family: var(--font-sans);
  font-size: clamp(32px, 9vw, 64px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.25;
}
.menu-open { overflow: hidden; }

/* ---------- 섹션 라벨: 위에 선 + 작은 대문자 ---------- */
.eyebrow {
  font-family: var(--font-sans);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- 버튼: 알약 모양 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  transition: background-color .2s, color .2s;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #3a3a3a; border-color: #3a3a3a; }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* ---------- 스크롤 등장 (JS가 있을 때만) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

@media (min-width: 768px) { .site-header .logo { font-size: 18px; } }
@media (min-width: 768px) { .menu-btn { right: 30px; } }
