:root {
  --bg: #0a0d1c;
  --bg-2: #10152b;
  --panel: #141a33;
  --panel-2: #1a2142;
  --line: #2a3360;
  --text: #eef1ff;
  --muted: #a3abd4;
  --dim: #6f78a6;
  --cyan: #46e6ff;
  --pink: #ff4fd8;
  --amber: #ffd166;
  --green: #5dffa0;
  --violet: #9b7bff;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Black Han Sans", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: #111; padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip:focus { left: 16px; }

/* ---------- night sky backdrop ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(155, 123, 255, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(70, 230, 255, .10), transparent 60%),
    linear-gradient(180deg, #070a17 0%, var(--bg) 40%, #0c1024 100%);
}
.moon { position: absolute; top: 72px; right: 8%; width: 64px; height: 64px; border-radius: 50%;
  box-shadow: inset -14px 6px 0 0 var(--amber); filter: drop-shadow(0 0 18px rgba(255, 209, 102, .55)); opacity: .9; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; opacity: .28;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 209, 102, .55) 14px 20px, transparent 20px 34px) 0 30px / 100% 8px no-repeat,
    linear-gradient(#0a0d1c, #0a0d1c);
  -webkit-mask: linear-gradient(transparent, #000 40%);
          mask: linear-gradient(transparent, #000 40%);
  clip-path: polygon(0 40%, 8% 40%, 8% 15%, 16% 15%, 16% 55%, 22% 55%, 22% 5%, 31% 5%, 31% 45%, 40% 45%, 40% 25%, 47% 25%, 47% 60%, 55% 60%, 55% 10%, 63% 10%, 63% 50%, 72% 50%, 72% 20%, 80% 20%, 80% 45%, 90% 45%, 90% 0, 100% 0, 100% 100%, 0 100%);
}

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(10, 13, 28, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(70, 230, 255, .12); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); position: relative; flex: none; }
.brand-mark::before { content: ""; position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset -5px 2px 0 0 var(--amber); }
.brand-mark::after { content: ""; position: absolute; left: 6px; bottom: 6px; width: 5px; height: 5px; background: var(--cyan);
  box-shadow: 8px 0 0 var(--pink), 0 -8px 0 rgba(70, 230, 255, .35); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--display); font-weight: 400; font-size: 21px; letter-spacing: .06em;
  color: #fff; text-shadow: 0 0 10px rgba(255, 79, 216, .75), 0 0 26px rgba(255, 79, 216, .35); }
.brand-text small { font-size: 10px; letter-spacing: .5em; color: var(--cyan); margin-top: 4px; font-weight: 700; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 10px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.lang { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
.lang:hover { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(70, 230, 255, .15); }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px; min-width: 0; }
.top > * { min-width: 0; }

/* ---------- hero ---------- */
.hero { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; border-radius: 26px; overflow: hidden;
  background: linear-gradient(135deg, rgba(26, 33, 66, .95), rgba(16, 21, 43, .95));
  border: 1px solid rgba(255, 79, 216, .28);
  box-shadow: 0 0 0 1px rgba(70, 230, 255, .06), 0 30px 80px rgba(0, 0, 0, .55), 0 0 60px rgba(255, 79, 216, .12); }
.hero-media { position: relative; min-height: 100%; background: #000; }
.hero-media img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; aspect-ratio: 16 / 9; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, rgba(20, 26, 51, .95)); }
.hero-scan { position: absolute; inset: 0; z-index: 1; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px); pointer-events: none; }
.hero-body { padding: 36px 36px 30px 28px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--green); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.eyebrow.small { color: var(--cyan); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero-title { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 5vw, 58px); line-height: 1.08; margin: 0 0 12px;
  text-shadow: 0 0 22px rgba(255, 209, 102, .35); }
.hero-hook { margin: 0 0 16px; font-size: 18px; color: #dfe4ff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.hero-note { margin: 0; font-size: 13px; color: var(--dim); }
.linkish { background: none; border: 0; padding: 0; color: var(--cyan); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 14px;
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-play { background: linear-gradient(180deg, #ffe08a, var(--amber)); color: #1d1405; box-shadow: 0 6px 0 #b8892a, 0 10px 30px rgba(255, 209, 102, .25); }
.btn-play:hover { box-shadow: 0 6px 0 #b8892a, 0 10px 40px rgba(255, 209, 102, .5); transform: translateY(-1px); }
.btn-play:active { box-shadow: 0 3px 0 #b8892a; transform: translateY(3px); }
.play-ico { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(70, 230, 255, .2); }
.btn-discord { background: #5865f2; color: #fff; box-shadow: 0 6px 0 #3640a8; }
.btn-discord:hover { box-shadow: 0 6px 0 #3640a8, 0 10px 30px rgba(88, 101, 242, .45); }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: 15px; border-radius: 12px; }

/* ---------- sections ---------- */
.block { padding: 64px 0 8px; scroll-margin-top: 70px; }
.block-head { max-width: 720px; margin-bottom: 22px; }
.block h2 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; margin: 0 0 8px; }
.block-desc { margin: 0; color: var(--muted); }

/* ---------- filters ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 8px; }
.filters > * { min-width: 0; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-label { font-size: 13px; color: var(--dim); font-weight: 700; min-width: 44px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 0 16px; min-height: 40px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); border-color: #4a5594; }
.chip[aria-pressed="true"] { color: #0a0d1c; background: var(--cyan); border-color: var(--cyan); font-weight: 700; box-shadow: 0 0 18px rgba(70, 230, 255, .35); }
.chip .n { opacity: .65; font-size: 12px; margin-left: 4px; }
.count { color: var(--dim); font-size: 13px; margin: 6px 0 14px; min-height: 1.2em; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card:hover, .card:focus-within { transform: translateY(-4px); border-color: rgba(70, 230, 255, .55); box-shadow: var(--shadow), 0 0 28px rgba(70, 230, 255, .18); }
.card.is-demo { border-color: rgba(93, 255, 160, .4); }
.card.is-demo:hover { border-color: var(--green); box-shadow: var(--shadow), 0 0 30px rgba(93, 255, 160, .22); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #05070f; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s; filter: saturate(.92); }
.card:hover .thumb img { transform: scale(1.05); filter: saturate(1.1); }
.badge { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.badge.demo { background: rgba(93, 255, 160, .92); color: #062413; }
.badge.prototype { background: rgba(10, 13, 28, .82); color: var(--amber); border: 1px solid rgba(255, 209, 102, .55); }
.badge.cameo { left: auto; right: 10px; background: rgba(255, 79, 216, .9); color: #fff; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--cyan); font-weight: 700; }
.meta .ver { color: var(--dim); font-weight: 500; }
.card h3 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 900; }
.card .hook { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; flex: 1; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 10px; }
.tags li { font-size: 12px; color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); padding: 2px 9px; border-radius: 999px; }
.card .tags { margin: 2px 0 4px; }
.card-actions { display: flex; gap: 8px; margin-top: 4px; }
.card-actions .btn { flex: 1; }
.card-actions .btn-ghost { flex: 0 0 auto; }
.empty, .error { text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.error { color: var(--amber); }

/* ---------- Kim universe timeline ---------- */
.kim { position: relative; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4%; right: 4%; top: 19px; height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan), var(--amber)); opacity: .7; }
.tl { position: relative; padding-top: 44px; }
.tl-time { position: absolute; top: 0; left: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; z-index: 1; white-space: nowrap; }
.tl-time i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--cyan)); box-shadow: 0 0 10px var(--c, var(--cyan)); }
.tl-card { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 100%;
  transition: transform .18s, border-color .18s, box-shadow .18s; }
.tl-card:hover { transform: translateY(-4px); border-color: var(--c, var(--cyan)); box-shadow: 0 0 26px color-mix(in srgb, var(--c, #46e6ff) 30%, transparent); }
.tl-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; height: auto; }
.tl-body { padding: 12px 14px 16px; }
.tl-body h3 { margin: 0 0 4px; font-size: 17px; font-weight: 900; line-height: 1.3; }
.tl-body p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.tl-body .tl-tag::after { content: "  ▶"; font-size: 10px; }
.tl-body .tl-tag { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--c, var(--cyan)); }

/* ---------- community ---------- */
.community-card { position: relative; overflow: hidden; border-radius: 26px; padding: 40px 36px; text-align: center;
  background: radial-gradient(600px 240px at 50% 0%, rgba(255, 79, 216, .18), transparent 70%), var(--panel);
  border: 1px solid rgba(255, 79, 216, .3); }
.community-card .block-desc { max-width: 560px; margin: 0 auto; }
.comm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.comm-actions:empty, .comm-actions.none { display: none; }
.comm-none { margin: 18px auto 0; max-width: 520px; font-size: 14px; color: var(--dim); }

/* ---------- footer ---------- */
.foot { max-width: 1180px; margin: 72px auto 0; padding: 28px 16px 48px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13.5px; }
.foot p { margin: 0 0 6px; }
.foot-brand b { font-family: var(--display); font-weight: 400; color: var(--text); letter-spacing: .05em; margin-right: 6px; }
.promise { color: var(--muted); }
.foot a { color: var(--cyan); }

/* ---------- "how was it?" return panel ---------- */
.back { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: min(380px, calc(100vw - 32px)); background: rgba(20, 26, 51, .97); border: 1px solid rgba(70, 230, 255, .45);
  border-radius: 20px; padding: 18px 18px 16px; box-shadow: var(--shadow), 0 0 40px rgba(70, 230, 255, .2); animation: rise .35s ease; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.back-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; }
.back-x:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.back-title { margin: 0 40px 2px 0; font-weight: 900; font-size: 17px; }
.back-desc { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.back-list { display: grid; gap: 8px; }
.mini { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); transition: border-color .15s; }
.mini:hover { border-color: var(--cyan); }
.mini img { width: 88px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; }
.mini b { display: block; font-size: 14.5px; line-height: 1.3; }
.mini span { font-size: 12px; color: var(--dim); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--cyan); color: #06121a; font-weight: 700; padding: 10px 18px; border-radius: 999px; z-index: 60; box-shadow: var(--shadow); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-media::after { background: linear-gradient(180deg, transparent 55%, rgba(20, 26, 51, .95)); }
  .hero-body { padding: 4px 24px 26px; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .timeline::before { display: none; }
}
@media (max-width: 640px) {
  .top { gap: 10px; padding: 10px 16px; }
  .nav { display: none; }
  .lang { margin-left: auto; }
  .brand-text b { font-size: 19px; }
  .moon { top: 64px; width: 44px; height: 44px; right: 16px; }
  .hero { margin-top: 16px; border-radius: 20px; }
  .hero-body { padding: 2px 18px 22px; }
  .hero-hook { font-size: 16px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .block { padding-top: 48px; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .timeline { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -16px; padding: 0 16px 10px; scrollbar-width: none; }
  .timeline::-webkit-scrollbar { display: none; }
  .tl { flex: 0 0 78%; scroll-snap-align: start; scroll-margin-left: 16px; }
  .community-card { padding: 30px 18px; border-radius: 20px; }
  .comm-actions .btn { flex: 1 1 100%; }
  .back { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
