/* 치즈안경 스튜디오 — 공용 스타일
   흰 바탕 · 검은 글자 · 나눔고딕 볼드. 색 · 글꼴 · 간격은 맨 위 변수에서만 바꾼다. */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #8a8a8a;
  --line: #ececec;
  --radius: 12px;
  --max: 760px;
  --font: "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.55; }
img { max-width: 100%; height: auto; display: block; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* --- 머리 · 메뉴 --- */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 24px; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a[aria-current="page"] { color: var(--ink); }

/* --- 본문 --- */
main { padding-top: 56px; padding-bottom: 96px; }
h1, h2, h3 { font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 0.6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.1rem; margin-top: 3em; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.section-title { font-size: 13px; color: var(--muted); letter-spacing: 0.06em; margin: 64px 0 14px; }

/* --- 메인: 3D 로고 --- */
.home { padding-top: 0; }
.stage { position: relative; height: min(58vh, 520px); margin: 0 -20px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.stage canvas:active { cursor: grabbing; }
.stage .fallback { position: absolute; inset: 0; margin: auto; width: 180px; height: 180px; display: none; }
.stage.no-3d canvas { display: none; }
.stage.no-3d .fallback { display: block; }
/* 모델 아래 바닥 그림자 (모델이 다 올라오며 진해진다) */
.stage .shadow { position: absolute; left: 50%; bottom: 12%; width: 300px; height: 34px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.13), rgba(0, 0, 0, 0)); opacity: 0; transition: opacity 1.6s ease-in; pointer-events: none; }
.stage.ready .shadow { opacity: 1; }

/* --- 목록 (게시글) --- */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; }
.list time { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- 카드 (포트폴리오) --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { display: block; }
.card:hover { opacity: 1; }
.card:hover .shot, .card:hover img { opacity: 0.8; }
.card .shot, .card img { border-radius: var(--radius); transition: opacity 0.15s ease; }
.card h3 { margin: 12px 0 2px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

/* 스크린샷이 준비되기 전 자리 (이미지로 바꾸면 지운다) */
.shot { aspect-ratio: 16 / 9; background: #f4f4f4; border-radius: var(--radius); display: grid; place-items: center; color: #b5b5b5; font-size: 13px; }

/* --- 글 본문 --- */
.post-meta { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.prose img { border-radius: var(--radius); margin: 1.6em 0; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose blockquote { margin: 1.4em 0; padding-left: 16px; border-left: 3px solid var(--ink); }
.back { display: inline-block; margin-top: 48px; font-size: 14px; color: var(--muted); }

/* 표 (프로젝트 정보 · 사람) */
.facts { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 24px; }
.facts th, .facts td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-weight: 700; }
.facts th { width: 110px; color: var(--muted); }

.more { display: inline-block; margin-top: 16px; font-size: 14px; color: var(--muted); }

/* --- 꼬리 --- */
.site-footer { padding: 32px 0 48px; font-size: 13px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (max-width: 560px) {
  h1 { font-size: 1.7rem; }
  .nav { gap: 16px; }
  .stage { height: 46vh; }
  main { padding-top: 40px; padding-bottom: 72px; }
}

/* --- 소개: 만화책 날개의 작가 소개처럼 (초상화 + 이름 + 한 줄). 선 · 모서리 · 바탕은 목록 · 카드와 같게 --- */
.author { display: flex; gap: 24px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.author-portrait { flex: none; width: 120px; margin: 0; }
.author-portrait img { width: 120px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: #f4f4f4; }
.author-name { font-size: 1.15rem; font-weight: 800; margin: 0 0 6px; }
.author-comment { font-size: 15px; color: var(--muted); margin: 0; }

@media (max-width: 560px) {
  .author { gap: 16px; }
  .author-portrait, .author-portrait img { width: 92px; }
}

.empty { color: var(--muted); margin: 8px 0 0; }

/* 언어 전환 (KO · EN) — 메뉴와 가는 선으로 나눈다 */
.nav .lang { padding-left: 18px; border-left: 1px solid var(--line); font-size: 13px; letter-spacing: 0.04em; }

/* 브랜드 글자 — 마우스를 올리면 게임 글자 효과(text_effect.gdshader)처럼 무지개색이 오른쪽으로 흐르고,
   글자가 차례로 위아래로 물결친다. 글자마다 --i(순서)만큼 시간을 어긋나게 해 흐름과 물결을 만든다.
   (지연을 (i - 20) × 간격으로 두어 모두 음수 — 올리자마자 바로 움직이면서 왼쪽 → 오른쪽으로 흐른다) */
.brand:hover { opacity: 1; }
.brand .wave span { display: inline-block; }
.brand:hover .wave span {
  animation: brand-wave 0.9s ease-in-out infinite, brand-rgb 1.6s linear infinite;
  animation-delay: calc((var(--i) - 20) * 0.11s), calc((var(--i) - 20) * 0.12s);
}
@keyframes brand-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
/* 색은 게임 무지개와 같은 채도 0.75, 흰 바탕에서 읽히게 밝기는 조금 낮춘다. 시간에 따라 색상값이 줄어 오른쪽으로 흐른다 */
@keyframes brand-rgb {
  0% { color: hsl(360 75% 48%); }
  16.66% { color: hsl(300 75% 48%); }
  33.33% { color: hsl(240 75% 52%); }
  50% { color: hsl(180 75% 38%); }
  66.66% { color: hsl(120 75% 36%); }
  83.33% { color: hsl(60 75% 40%); }
  100% { color: hsl(0 75% 48%); }
}
@media (prefers-reduced-motion: reduce) {
  .brand:hover .wave span { animation-name: none, brand-rgb; }
}

/* --- 메인 3D 로고 클릭: 오른쪽 아래 치즈 수 · 누른 자리에 떠오르는 "치즈 +1" --- */
.stage .counter { position: absolute; right: 20px; bottom: 8px; z-index: 1; display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; pointer-events: none; }
.stage .counter img { width: 26px; height: 26px; }
.stage .counter.bump .count { display: inline-block; animation: count-bump 0.25s ease-out; }
@keyframes count-bump { 40% { transform: scale(1.3); } }
.stage.no-3d .counter, .stage .counter.empty { display: none; }
/* 리셋 버튼 — 카운터 옆 작은 글자 버튼 (카운터는 누르기를 통과시키므로 버튼만 누를 수 있게) */
.stage .counter .reset { pointer-events: auto; margin-left: 6px; padding: 0 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.stage .counter .reset:hover { color: var(--ink); }

.plus { position: absolute; z-index: 2; display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 800; white-space: nowrap; pointer-events: none;
  transform: translate(-50%, -50%); animation: plus-rise 0.9s ease-out forwards; }
.plus img { width: 22px; height: 22px; }
/* 톡 튀어나와 조금 커졌다가, 위로 떠오르며(양옆으로 --dx 만큼 흩어짐) 흐려진다 */
@keyframes plus-rise {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 64px)) scale(1); }
}

/* --- 탭 (포트폴리오 게임 / 소프트웨어) — 메뉴처럼 흐린 글자, 고른 탭은 검은 글자 + 밑줄 --- */
.tabs { display: flex; gap: 24px; margin: 8px 0 28px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { padding: 10px 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
/* 스크립트가 없으면 두 목록이 모두 보이므로 사이에 간격을 둔다 */
[role="tabpanel"] + [role="tabpanel"] { margin-top: 32px; }
[role="tabpanel"][hidden] + [role="tabpanel"] { margin-top: 0; }
