/* DGSTUDIO 홈페이지 (dgstudio.co.kr) — 한국어 index.html · 영어 en/index.html 공용 스타일.
   색·서체는 스토어 개발자 페이지 헤더 이미지(어두운 갈색 바탕, 크림색 세리프, 금색 자간 문구, 빨간 책갈피)에 맞춘다. */

:root {
  --bg: #14100d;
  --bg-2: #1a1511;
  --panel: #1f1914;
  --panel-2: #29211b;
  --line: rgba(236, 224, 200, 0.10);
  --line-2: rgba(236, 224, 200, 0.20);
  --ink: #efe6d3;
  --ink-2: #d8ccb5;
  --muted: #a99c86;
  --faint: #7c705e;
  --gold: #c9a46b;
  --gold-2: #e3c690;
  --red: #b0302a;
  --red-2: #d4493d;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", Pretendard, "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
h1, h2, h3, .tagline, .intro p { text-wrap: balance; }
p, li span { text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.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; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--ink); color: var(--bg); padding: 6px 12px; }

/* ── 상단 막대 ─────────────────────────────── */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color .35s ease, border-color .35s ease, backdrop-filter .35s ease;
}
.top.scrolled {
  background: rgba(20, 16, 13, 0.82);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  backdrop-filter: saturate(1.2) blur(14px);
  border-bottom-color: var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line-2); }
.brand span { font-family: var(--serif); font-size: 16px; letter-spacing: .16em; color: var(--ink); }
.top nav { display: flex; align-items: center; gap: 2px; }
.top nav a {
  text-decoration: none; color: var(--ink-2); font-size: 14px;
  padding: 7px 12px; border-radius: 999px; transition: color .2s, background-color .2s;
}
.top nav a:hover { color: var(--ink); background: rgba(239, 230, 211, 0.07); }
.top nav a.lang {
  margin-left: 8px; padding: 5px 12px; font-size: 12px; letter-spacing: .08em;
  border: 1px solid var(--line-2); color: var(--ink);
}
@media (max-width: 480px) {
  .top .wrap { width: calc(100% - 32px); }
  .top nav a { padding: 7px 8px; font-size: 13px; }
  .top nav a.opt { display: none; }
  .brand span { font-size: 14px; letter-spacing: .12em; }
}

/* ── 첫 화면 ───────────────────────────────── */
.hero { position: relative; background: #1b1613; overflow: hidden; }
.hero img {
  width: 100%;
  height: clamp(400px, 56.25vw, 100svh);
  object-fit: cover; object-position: 50% 46%;
}
.hero::before {
  /* 투명한 상단 막대 글자가 그림 속 빨간 책갈피 위에 걸려도 읽히도록 위쪽을 살짝 어둡게 */
  content: ""; position: absolute; inset: 0 0 auto; height: 140px; z-index: 1;
  background: linear-gradient(to bottom, rgba(20, 16, 13, 0.55), rgba(20, 16, 13, 0));
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 34%;
  background: linear-gradient(to bottom, rgba(20, 16, 13, 0), var(--bg));
  pointer-events: none;
}
.hero-cue {
  position: absolute; left: 50%; bottom: clamp(18px, 4vw, 44px); z-index: 2;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; letter-spacing: .12em; text-decoration: none;
}
.hero-cue::after {
  content: ""; width: 9px; height: 9px; margin-top: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); animation: cue 2.2s ease-in-out infinite;
}
.hero-cue:hover { color: var(--ink); }
@keyframes cue { 0%, 100% { transform: translateY(0) rotate(45deg); opacity: .55; } 50% { transform: translateY(5px) rotate(45deg); opacity: 1; } }

/* ── 소개 한 줄 ───────────────────────────── */
.intro { text-align: center; padding: clamp(40px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); }
.intro p {
  margin: 0; font-size: clamp(21px, 3.1vw, 34px); line-height: 1.6; font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink);
}
.intro p .soft { color: var(--muted); font-weight: 500; }
.rule { width: 72px; height: 2px; margin: 26px auto 0; background: var(--red); border: 0; }

/* ── 공통 제목 ───────────────────────────── */
.eyebrow {
  margin: 0 0 10px; font-family: var(--serif); font-size: 13px; font-weight: 600;
  letter-spacing: .34em; color: var(--gold);
}
.section-head { text-align: center; margin-bottom: clamp(28px, 5vw, 56px); }
.section-head h2, .studio h2, .contact h2 {
  margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 700;
}

/* ── 작품 ─────────────────────────────────── */
.works { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 80px); }
.work {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(28px, 5vw, 64px);
  margin-bottom: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line); border-radius: 30px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(201, 164, 107, 0.10), transparent 55%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}
.work.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.work.flip .work-visual { order: -1; }
.work-mor {
  background:
    radial-gradient(110% 90% at 0% 100%, rgba(128, 86, 214, 0.16), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(201, 164, 107, 0.10), transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}
.work-id { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.app-icon { width: 68px; height: 68px; border-radius: 17px; flex: none; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }
.kicker { margin: 0 0 2px; font-size: 13px; color: var(--gold); letter-spacing: .04em; }
.work h3 { margin: 0; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.2; letter-spacing: -0.02em; }
.work h3 small { display: block; margin-top: 4px; font-size: .46em; font-weight: 500; line-height: 1.3; color: var(--muted); letter-spacing: .02em; }
.tagline { margin: 0 0 22px; font-size: clamp(17px, 1.9vw, 20px); color: var(--ink-2); line-height: 1.6; }
.features { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; }
.features li { position: relative; padding-left: 22px; }
.features li::before {
  content: ""; position: absolute; left: 2px; top: .72em; width: 8px; height: 8px;
  background: var(--red-2); transform: rotate(45deg);
}
.work-mor .features li::before { background: var(--gold); }
.features strong { display: block; font-size: 16px; color: var(--ink); line-height: 1.5; }
.features span { display: block; font-size: 14.5px; color: var(--muted); line-height: 1.65; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.status {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink-2);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(201, 164, 107, .18); }
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.links a { font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; transition: color .2s, border-color .2s; }
.links a:hover { color: var(--ink); border-color: var(--gold); }

/* 종이결 — 휴대전화 세 대를 부채꼴로 */
.phones { position: relative; height: clamp(360px, 44vw, 560px); }
.phone {
  position: absolute; left: 50%; top: 50%; margin: 0;
  width: clamp(138px, 17vw, 228px); aspect-ratio: 9 / 16;
  padding: 6px; border-radius: 26px; background: #0b0908;
  box-shadow: 0 34px 70px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .09);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.phone.p1 { transform: translate(-112%, -46%) rotate(-8deg); }
.phone.p2 { transform: translate(-50%, -54%); z-index: 2; }
.phone.p3 { transform: translate(12%, -46%) rotate(8deg); }
.work:hover .phone.p1 { transform: translate(-118%, -47%) rotate(-10deg); }
.work:hover .phone.p3 { transform: translate(18%, -47%) rotate(10deg); }
.ribbon {
  position: absolute; top: 0; right: clamp(28px, 7%, 84px); width: 22px; height: 64px;
  background: var(--red); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

/* 게임 — 기울인 화면 */
.screen { position: relative; }
.screen::before {
  content: ""; position: absolute; inset: 8% 6%;
  background: radial-gradient(closest-side, rgba(150, 105, 255, .45), rgba(226, 198, 144, .12) 60%, transparent);
  filter: blur(42px); z-index: 0;
}
.monitor {
  position: relative; z-index: 1; margin: 0; border-radius: 18px; overflow: hidden;
  box-shadow: 0 36px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .10);
  transform: perspective(1600px) rotateY(9deg) rotateX(3deg);
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.work:hover .monitor { transform: perspective(1600px) rotateY(3deg) rotateX(1deg); }
.monitor img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.monitor figcaption {
  position: absolute; left: 14px; bottom: 12px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; color: #f6efe0; background: rgba(12, 10, 8, .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pixels { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; position: relative; z-index: 1; }
.pixels i { width: 10px; height: 10px; background: var(--gold); opacity: .55; }
.pixels i:nth-child(2) { background: var(--red-2); }
.pixels i:nth-child(3) { background: #9a7be0; }

@media (max-width: 900px) {
  .work, .work.flip { grid-template-columns: 1fr; }
  .work.flip .work-visual { order: 0; }
  .phones { height: clamp(300px, 84vw, 520px); }
  .phone { width: clamp(124px, 35vw, 210px); }
  .monitor { transform: none; }
  .work:hover .monitor { transform: none; }
  .pixels { display: none; }
}
@media (max-width: 480px) {
  .wrap { width: calc(100% - 32px); }
  .work { border-radius: 24px; padding: 24px 20px 28px; }
  .app-icon { width: 58px; height: 58px; border-radius: 14px; }
}

/* ── 스튜디오 ─────────────────────────────── */
.studio { padding: clamp(56px, 9vw, 110px) 0; text-align: center; border-top: 1px solid var(--line); }
.studio .lead { max-width: 640px; margin: 20px auto 0; color: var(--ink-2); font-size: clamp(16px, 1.8vw, 18px); line-height: 1.85; }
.stats { list-style: none; padding: 0; margin: clamp(36px, 6vw, 60px) auto 0; max-width: 820px; display: grid; grid-template-columns: repeat(3, 1fr); }
.stats li { padding: 8px 12px; }
.stats li + li { border-left: 1px solid var(--line); }
.stats b { display: block; font-family: var(--serif); font-size: clamp(38px, 6vw, 60px); line-height: 1.1; font-weight: 500; color: var(--gold-2); }
.stats span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }

/* ── 문의 ─────────────────────────────────── */
.contact { padding: clamp(56px, 9vw, 100px) 0 clamp(64px, 10vw, 120px); text-align: center; border-top: 1px solid var(--line); }
.contact .lead { margin: 16px auto 0; max-width: 560px; color: var(--muted); }
.mails { margin: 36px auto 0; max-width: 760px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mail {
  display: block; text-align: left; text-decoration: none; padding: 22px 24px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2);
  transition: border-color .25s, transform .25s, background-color .25s;
}
.mail:hover { border-color: var(--gold); transform: translateY(-2px); background: var(--panel); }
.mail span { display: block; font-size: 13px; color: var(--gold); letter-spacing: .02em; }
.mail strong { display: block; margin-top: 6px; font-size: clamp(15px, 1.8vw, 18px); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 640px) { .mails { grid-template-columns: 1fr; } .stats b { font-size: 40px; } }

/* ── 바닥글 ───────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 32px 0 44px; color: var(--faint); font-size: 12.5px; line-height: 1.9; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; }
.foot .info { max-width: 820px; }
.foot .biz { margin: 0; }
.foot .biz span { white-space: nowrap; }
.foot .biz span + span::before { content: "·"; margin: 0 8px; color: var(--faint); }
.foot .copy { margin: 0; font-family: var(--serif); letter-spacing: .12em; }
@media (max-width: 640px) {
  .foot .biz span { display: block; white-space: normal; }
  .foot .biz span + span::before { content: none; }
}

/* ── 스크롤 등장 효과 (JS가 켜졌을 때만) ───── */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-cue::after { animation: none; }
  .phone, .monitor, .mail { transition: none; }
}
