@font-face {
  font-family: "DOSMyungjo";
  src: url("/assets/font/DOSMyungjo.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #0b0b0d;
  --bg-2: #141418;
  --ink: #e9e7e2;
  --ink-dim: #9a9890;
  --red: #e10600;
  --red-dark: #9b0400;
  --light: #6f8cff;
  --line: rgba(233, 231, 226, .12);
  --serif: "DOSMyungjo", "Nanum Myeongjo", serif;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(11, 11, 13, .88); backdrop-filter: blur(8px); border-color: var(--line); }
.nav-logo { font-family: var(--serif); font-size: 22px; letter-spacing: .06em; text-decoration: none; color: var(--red); white-space: nowrap; }
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { text-decoration: none; color: #d6d3cc; text-shadow: 0 1px 6px rgba(0,0,0,.9); font-size: 15px; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tool {
  font: 600 12px/1 var(--sans); letter-spacing: .08em;
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 4px;
  height: 34px; padding: 0 10px; cursor: pointer;
}
.tool:hover { color: var(--ink); border-color: var(--ink-dim); }
#soundToggle .sound-on { display: none; }
#soundToggle[aria-pressed="true"] .sound-on { display: inline; color: var(--red); }
#soundToggle[aria-pressed="true"] .sound-off { display: none; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 28px;
  font: 700 16px/1 var(--sans); letter-spacing: .02em;
  text-decoration: none; border-radius: 2px; cursor: pointer; border: 0;
  transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 0 0 0 rgba(225, 6, 0, .5); }
.btn-red:hover { background: #ff1a10; box-shadow: 0 0 32px rgba(225, 6, 0, .45); }
.btn-ghost { background: rgba(0,0,0,.35); color: var(--ink); border: 1px solid rgba(233,231,226,.4); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 60px; padding: 0 40px; font-size: 18px; }

/* ---------- HERO ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #000; }
.hero-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 50%;
  image-rendering: pixelated;
  animation: hero-in 2.4s ease-out both;
}
@keyframes hero-in { from { transform: scale(1.08); filter: brightness(.2); } to { transform: none; filter: none; } }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 25%, transparent 50%, rgba(11,11,13,.92) 88%, var(--bg) 100%); }
.rain {
  position: absolute; inset: -20% 0 0; pointer-events: none; opacity: .35;
  background-image:
    repeating-linear-gradient(105deg, transparent 0 18px, rgba(255,255,255,.18) 18px 19px, transparent 19px 61px),
    repeating-linear-gradient(105deg, transparent 0 33px, rgba(255,255,255,.1) 33px 34px, transparent 34px 89px);
  background-size: 100% 240px, 100% 330px;
  animation: rain .5s linear infinite;
}
@keyframes rain { to { background-position: -64px 240px, -88px 330px; } }
.hero-copy { position: absolute; left: 0; right: 0; bottom: 9vh; width: min(1120px, 100% - 32px); margin-inline: auto; }
.eyebrow { margin: 0 0 8px; font-size: 13px; letter-spacing: .2em; color: var(--ink-dim); text-transform: uppercase; }
.hero-tag { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 7vw, 88px); line-height: 1.1; text-shadow: 0 4px 30px #000; }
.hero-sub { margin: 14px 0 28px; font-size: clamp(16px, 1.6vw, 20px); color: #cfccc5; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.scroll-hint { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; color: var(--ink-dim); text-decoration: none; font-size: 12px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- STORY ---------- */
.story { background: #000; }
.cut { position: relative; height: 100svh; min-height: 480px; overflow: hidden; }
.cut img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cut-0 img { filter: contrast(1.1); }
.cut-title {
  position: absolute; inset: 0; margin: 0;
  display: grid; place-content: center; text-align: center;
  font-family: var(--serif); font-size: clamp(56px, 11vw, 150px); line-height: 1.05;
  text-shadow: 0 0 40px #000, 0 0 12px #000;
}
.radio {
  position: absolute; margin: 0; max-width: min(620px, calc(100% - 32px));
  right: 6vw; top: 14vh;
  font-family: var(--serif); font-size: clamp(20px, 2.4vw, 32px); line-height: 1.5;
  text-shadow: 0 2px 10px #000;
}
.cut-2 .radio { right: auto; left: 6vw; top: auto; bottom: 16vh; }
.radio-who { display: block; font-family: var(--sans); font-size: 13px; letter-spacing: .25em; color: var(--red); margin-bottom: 6px; }
.radio-who::before { content: "◉ "; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.story-text { padding: 120px 0; max-width: 760px; font-family: var(--serif); font-size: clamp(19px, 2vw, 24px); line-height: 1.9; text-align: center; color: #d6d3cc; }

/* ---------- SECTION ---------- */
.sec-title { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.2; margin: 0 0 16px; }
.sec-title.sm { font-size: clamp(26px, 3vw, 36px); }
.sec-lead { color: var(--ink-dim); max-width: 40em; margin: 0 0 48px; }

/* ---------- CHARACTERS ---------- */
.characters { padding: 140px 0 120px; }
.char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; }
.char {
  position: relative; display: grid; grid-template-columns: 44% 1fr; gap: 0;
  background: linear-gradient(160deg, #1b1d1a, #101110);
  border: 1px solid var(--line); overflow: hidden;
}
.char-portrait::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, rgba(0,0,0,.35)); }
.char-ellie { background: linear-gradient(160deg, #1d1a1c, #111012); }
.char-portrait { position: relative; align-self: end; overflow: hidden; }
.char-portrait img { width: 100%; height: auto; image-rendering: pixelated; transition: transform .4s; transform-origin: bottom center; }
.char:hover .char-portrait img { transform: scale(1.03); }
.char-body { padding: 28px 24px 24px; }
.char-role { margin: 0; font-size: 12px; letter-spacing: .2em; color: var(--red); }
.char-name { font-family: var(--serif); font-weight: 400; font-size: 40px; margin: 4px 0 12px; }
.char-body p:not(.char-role) { color: #c5c2bb; font-size: 15px; margin: 0; }
.sprite-row { display: flex; gap: 4px; margin-top: 16px; }
.sprite-row .sprite { --scale: .6; }
.ammo-row { display: flex; gap: 2px; margin-top: 20px; }
.ammo-row img { width: 36px; image-rendering: pixelated; }

.sprite {
  --scale: 1;
  width: calc(var(--fw) * var(--scale) * 1px);
  height: calc(var(--fh) * var(--scale) * 1px);
  background-repeat: no-repeat;
  image-rendering: pixelated;
  flex: none;
}

/* dialog box (게임 대화창 재현) */
.dialog { display: flex; align-items: flex-end; gap: 0; margin-top: 64px; max-width: 860px; margin-inline: auto; }
.dialog-face { width: 140px; flex: none; }
.dialog-face img { width: 100%; image-rendering: pixelated; }
.dialog-box { position: relative; flex: 1; min-height: 130px; background: rgba(8,8,10,.92); border: 2px solid #3a3a3e; padding: 28px 56px 20px 24px; }
.dialog-name { position: absolute; top: -16px; left: 18px; background: var(--red-dark); color: #fff; font-size: 14px; padding: 4px 16px; letter-spacing: .1em; }
.dialog-text { margin: 0; font-family: var(--serif); font-size: clamp(17px, 1.8vw, 21px); min-height: 2.6em; }
.dialog-next { position: absolute; right: 14px; bottom: 12px; background: none; border: 0; color: var(--ink); cursor: pointer; font-size: 14px; animation: blink 1s steps(2) infinite; }

/* ---------- GAMEPLAY ---------- */
.gameplay { padding: 120px 0; background: linear-gradient(180deg, var(--bg), #0f1014 30%, #0f1014 70%, var(--bg)); }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat { background: var(--bg-2); border: 1px solid var(--line); padding: 0 0 24px; }
.feat h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 20px 22px 8px; }
.feat p { margin: 0 22px; color: var(--ink-dim); font-size: 15px; }
.feat-stage {
  height: 180px; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 70%, #2a2b33 0%, #121216 70%);
  border-bottom: 1px solid var(--line);
}
.feat-items { display: flex; justify-content: center; align-items: center; gap: 18px; }
.feat-items img { width: 56px; image-rendering: pixelated; animation: float 2.4s ease-in-out infinite; }
.feat-items img:nth-child(2) { animation-delay: -.6s; }
.feat-items img:nth-child(3) { animation-delay: -1.2s; }
.feat-items img:nth-child(4) { animation-delay: -1.8s; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- DEMO ---------- */
.demo { padding: 120px 0 80px; }
.stage {
  --x: 50%; --y: 50%; --r: 150px;
  position: relative; width: min(1280px, 100% - 32px); margin-inline: auto;
  aspect-ratio: 16 / 9; overflow: hidden; background: #000;
  border: 1px solid var(--line); cursor: none; outline: none;
  touch-action: none; user-select: none;
}
.stage-bg { position: absolute; inset: 0; background: url("/assets/img/bg-b2.webp") center/cover, #3a3a44; }
.stage-bg::after { content: ""; position: absolute; inset: 0; background: url("/assets/img/bg-b1.webp") center/cover; }
.stage-world, .stage-zombies { position: absolute; inset: 0; }
.stage-dark {
  position: absolute; inset: 0; pointer-events: none;
  --mask: radial-gradient(circle at var(--x) var(--y), transparent calc(var(--r) * .7), #000 var(--r)),
          radial-gradient(ellipse 17% 30% at 14% 70%, transparent 35%, #000 100%);
  background: rgba(0,0,0,.94);
  -webkit-mask: var(--mask); -webkit-mask-composite: source-in;
  mask: var(--mask); mask-composite: intersect;
}
.stage.off .stage-dark { --x: -999px; --y: -999px; }
.stage .ent { position: absolute; image-rendering: pixelated; background-repeat: no-repeat; }
.stage .zombie { transition: opacity .1s linear; }
.stage .dave { pointer-events: none; }
.stage-hud { position: absolute; left: 16px; right: 16px; top: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; font-size: 14px; letter-spacing: .1em; }
.hud-ammo { display: flex; gap: 2px; }
.hud-ammo img { width: 28px; image-rendering: pixelated; }
.hud-ammo img.spent { opacity: .2; }
.hud-ammo .reloading { color: var(--red); font-size: 13px; margin-left: 8px; align-self: center; }
.hud-score b { font-size: 20px; color: var(--red); margin-left: 6px; }
.stage-start { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); cursor: default; }
.stage:not(.off) .stage-start { display: none; }
.crosshair { position: absolute; width: 31px; left: 0; top: 0; pointer-events: none; image-rendering: pixelated; translate: -50% -50%; transform: scale(1.4); opacity: 0; }
.stage:not(.off) .crosshair { opacity: 1; }
.flash { position: absolute; width: 60px; height: 60px; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, #fff 0, rgba(255,220,150,.6) 30%, transparent 70%); pointer-events: none; animation: flash .12s ease-out forwards; }
@keyframes flash { to { opacity: 0; transform: scale(1.8); } }

/* ---------- CONTROLS ---------- */
.controls { padding: 60px 0 120px; }
.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 24px; }
.ctrl-col { border-top: 1px solid var(--line); padding-top: 16px; }
.ctrl-who { margin: 0 0 12px; color: var(--red); font-size: 13px; letter-spacing: .2em; }
.ctrl-col dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; margin: 0; align-items: center; }
.ctrl-col dt { display: flex; gap: 6px; }
.ctrl-col dd { margin: 0; color: #c5c2bb; }
kbd { display: inline-block; min-width: 34px; padding: 4px 8px; text-align: center; font: 600 13px/1.4 var(--sans); background: #1d1d22; border: 1px solid #3a3a42; border-bottom-width: 3px; border-radius: 4px; color: var(--ink); }

/* ---------- FINAL ---------- */
.final { position: relative; min-height: 90svh; display: grid; align-items: center; overflow: hidden; background: #000; }
.final > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.final::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.85) 20%, transparent 70%), linear-gradient(0deg, var(--bg), transparent 30%); }
.final-copy { position: relative; z-index: 1; padding: 120px 0; }
.final-heli { width: 180px; height: auto; margin-bottom: 20px; image-rendering: pixelated; animation: hover-heli 3s ease-in-out infinite; }
@keyframes hover-heli { 50% { transform: translate(6px, -8px) rotate(-2deg); } }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 16px; text-align: center; color: var(--ink-dim); font-size: 13px; }
.footer-logo { font-family: var(--serif); color: var(--red); font-size: 20px; margin: 0 0 6px; }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .char-grid, .ctrl-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav { padding: 0 16px; gap: 12px; }
  .nav-logo { font-size: 18px; }
  .nav-tools .btn-sm { display: none; }
  .feat-grid { grid-template-columns: 1fr; }
  .char { grid-template-columns: 40% 1fr; }
  .char-name { font-size: 30px; }
  .char-body { padding: 20px 16px; }
  .sprite-row .sprite { --scale: .42; }
  .dialog-face { width: 90px; }
  .radio { right: 16px; left: 16px; }
  .cut-2 .radio { left: 16px; }
  .stage { aspect-ratio: 4 / 5; }
  .hero-art { object-position: 22% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
