/*
 * JHL STUDIO — 밝은 아케이드
 * 셈셈 놀이터(어두운 네온)와 겹치지 않게, 낮에 보는 오락실 간판처럼 밝은 바탕에 원색과 굵은 픽셀 테두리를 써요.
 */
:root {
  --bg: #f3f5ff;        /* 옅은 하늘빛 종이 */
  --grid: #e1e6ff;      /* 모눈 */
  --paper: #ffffff;
  --ink: #1d1b3a;       /* 테두리·글자 */
  --dim: #5b5978;       /* 보조 글자 */
  --red: #ff5a4e;
  --blue: #3a8dff;
  --yellow: #ffcf33;
  --mint: #2fd0a0;
  --purple: #8b6cff;

  --pixel-en: "Press Start 2P", "Galmuri11", monospace;
  --pixel-ko: "Galmuri11", "Press Start 2P", monospace;
  --body: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

.pixel { font-family: var(--pixel-en); }
html[lang="ko"] .pixel-ko { font-family: var(--pixel-ko); font-weight: 700; }

/* 픽셀 상자: 굵은 테두리 + 딱 떨어지는 그림자 */
.box {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--pixel-ko);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: var(--paper); }
.btn:focus-visible, .chip:focus-visible, a:focus-visible { outline: 3px dashed var(--blue); outline-offset: 3px; }

.chip {
  min-height: 40px;
  padding: 4px 12px;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- 머리 ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark { width: 44px; height: 44px; image-rendering: pixelated; }
.brand-name { font-family: var(--pixel-en); font-size: 16px; letter-spacing: 0.04em; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px 16px;
  flex-wrap: wrap;
}
.nav a { font-weight: 700; font-size: 15px; text-decoration: none; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.lang { display: flex; gap: 6px; }

/* ---------- 첫 화면 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 56px;
}

.marquee {
  display: inline-block;
  padding: 6px 12px;
  border: 3px solid var(--ink);
  background: var(--mint);
  font-family: var(--pixel-en);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(30px, 5.4vw, 52px);
  line-height: 1.25;
  text-wrap: balance;
}
.hero h1 .pop { color: var(--red); text-shadow: 3px 3px 0 var(--yellow); }
html[lang="ko"] .hero h1 { font-family: var(--pixel-ko); font-weight: 700; }
html[lang="en"] .hero h1 { font-family: var(--pixel-en); font-size: clamp(22px, 3.8vw, 36px); line-height: 1.5; }

.hero p { margin: 0 0 24px; color: var(--dim); max-width: 34em; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* 오른쪽: 오락기 화면 */
.cabinet {
  position: relative;
  padding: 16px 16px 22px;
  background: var(--purple);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
.cabinet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--pixel-en);
  font-size: 10px;
  color: var(--paper);
}
.leds { display: flex; gap: 6px; }
.leds i { width: 10px; height: 10px; border: 2px solid var(--ink); display: block; }
.leds i:nth-child(1) { background: var(--red); }
.leds i:nth-child(2) { background: var(--yellow); }
.leds i:nth-child(3) { background: var(--mint); }
.cabinet-screen {
  display: block;
  border: 3px solid var(--ink);
  background: #0d0a1c;
  overflow: hidden;
}
.cabinet-screen img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; }
.cabinet-cap {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
}
.cabinet-cap .btn { min-height: 40px; padding: 6px 14px; font-size: 13px; }

/* ---------- 구역 공통 ---------- */
.section { padding-top: 24px; padding-bottom: 56px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.stage {
  font-family: var(--pixel-en);
  font-size: 11px;
  padding: 4px 8px;
  background: var(--ink);
  color: var(--yellow);
}
.section h2 { margin: 0; font-size: clamp(24px, 3.6vw, 32px); line-height: 1.3; }
html[lang="ko"] .section h2 { font-family: var(--pixel-ko); font-weight: 700; }
html[lang="en"] .section h2 { font-family: var(--pixel-en); font-size: clamp(16px, 2.6vw, 22px); }

/* ---------- 프로젝트 ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.project { display: flex; flex-direction: column; min-width: 0; }
.project-thumb { border-bottom: 3px solid var(--ink); background: #0d0a1c; }
.project-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; }
.project-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border: 2px solid var(--ink);
}
.tag.live { background: var(--mint); }
.tag.type { background: var(--yellow); }
.project h3 { margin: 4px 0 0; font-size: 22px; }
html[lang="ko"] .project h3 { font-family: var(--pixel-ko); font-weight: 700; }
.project p { margin: 0; color: var(--dim); }
.project .btn { align-self: flex-start; margin-top: auto; }

.project.next {
  border-style: dashed;
  box-shadow: none;
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 300px;
  padding: 28px;
  gap: 14px;
}
.project.next .pixel { font-size: 14px; color: var(--purple); }
.blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 소개 ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.about-text { padding: 24px; }
.about-text p { margin: 0 0 12px; }
.about-text p:last-child { margin: 0; }
.stats { display: grid; gap: 14px; }
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.stat b {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  font-family: var(--pixel-en);
  font-size: 12px;
}
.stat:nth-child(1) b { background: var(--red); color: var(--paper); }
.stat:nth-child(2) b { background: var(--blue); color: var(--paper); }
.stat:nth-child(3) b { background: var(--yellow); }
.stat span { font-weight: 700; }

/* ---------- 문의 ---------- */
.contact {
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--yellow);
}
.contact p { margin: 0 0 6px; font-weight: 700; }
.mail {
  font-family: var(--pixel-en);
  font-size: clamp(11px, 2.6vw, 15px);
  word-break: break-all;
  user-select: all;
}
.contact .btn { background: var(--paper); }

/* ---------- 바닥 ---------- */
.foot {
  padding-top: 26px;
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  color: var(--dim);
  font-size: 14px;
  border-top: 3px solid var(--ink);
}
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--red);
  font-weight: 700;
  z-index: 10;
}

/* ---------- 글 페이지 ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 30px 0 60px; }
.doc .box { padding: 26px; }
.doc h1 { margin: 0 0 6px; font-family: var(--pixel-ko); font-weight: 700; font-size: clamp(24px, 5vw, 32px); }
.doc h2 { margin: 26px 0 8px; font-size: 20px; }
.doc .meta { color: var(--dim); font-size: 14px; }

/* ---------- 휴대폰 ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; gap: 30px; }
  .projects, .about { grid-template-columns: 1fr; }
  .nav .links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.cabinet, .cabinet * { text-decoration: none; }
.cabinet:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--ink); }
.cabinet { transition: transform 0.08s, box-shadow 0.08s; }

/* 한국어는 단어 중간에서 줄이 끊기지 않게 ("만/드는" 방지) */
body { word-break: keep-all; overflow-wrap: break-word; }

/* 스튜디오 소개: 왼쪽 글 상자와 오른쪽 세 칸의 높이를 맞춰요 */
.about { align-items: stretch; }
.about-text { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.stats { grid-template-rows: repeat(3, minmax(0, 1fr)); height: 100%; }
.stat { height: 100%; }

/* 휴대폰에서는 억지 줄바꿈 대신 자연스럽게 흐르게 */
@media (max-width: 760px) {
  .hero p br, .about-text p br { display: none; }
}

.hero p { max-width: none; }

/* ---------- 글(블로그) ---------- */
.crumb { display: inline-block; margin-bottom: 14px; font-weight: 700; font-size: 15px; text-decoration: none; }
.crumb:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }

.posts { display: grid; gap: 18px; }
.post-card {
  display: block;
  padding: 20px 22px;
  text-decoration: none;
  transition: transform 0.06s, box-shadow 0.06s;
}
.post-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.post-card h3 { margin: 8px 0 6px; font-size: 20px; line-height: 1.4; }
.post-card p { margin: 0; color: var(--dim); font-size: 15px; }
.post-card .tag { display: inline-block; }
.tag.tip { background: var(--mint); }
.tag.life { background: var(--yellow); }
.tag.log { background: var(--purple); color: var(--paper); }

.post { line-height: 1.8; }
.post h1 { line-height: 1.35; margin-top: 10px; }
.post h2 {
  margin: 34px 0 10px;
  padding-left: 12px;
  border-left: 6px solid var(--red);
  font-size: 21px;
  line-height: 1.4;
}
.post p { margin: 0 0 14px; }
.post ul, .post ol { margin: 0 0 14px; padding-left: 1.3em; }
.post li { margin-bottom: 6px; }
.post .lead { font-size: 18px; color: var(--ink); }
.eg {
  margin: 12px 0 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 3px solid var(--ink);
  font-variant-numeric: tabular-nums;
}
.eg b { color: var(--red); }
.eg p { margin: 0 0 6px; }
.eg p:last-child { margin: 0; }
.cta {
  margin-top: 30px;
  padding: 20px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.cta p { margin: 0; font-weight: 700; }
.cta .btn { background: var(--paper); }
.more { margin-top: 26px; }
.more h2 { border-left-color: var(--blue); }
.more a { font-weight: 700; }
