:root {
  --bg: #0b0d1a;
  --bg-2: #12152a;
  --card: #161a33;
  --line: #2a3060;
  --text: #e9ebff;
  --muted: #9aa0c8;
  --yellow: #ffcc4d;
  --cyan: #5ee1ff;
  --violet: #a99bff;
  --pink: #ff7eb6;
  --px: 4px;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --pixel: "Galmuri11", "Galmuri9", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  word-break: keep-all;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
b { color: #fff; font-weight: 700; }

.pixel { font-family: var(--pixel); letter-spacing: .02em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

#stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; image-rendering: pixelated;
}

/* ---------- pixel helpers ---------- */
/* 계단 모양 테두리: 모던 카드에 픽셀 감성 */
.pixel-frame {
  position: relative;
  background: var(--card);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    var(--px) var(--px) 0 var(--px) rgba(0,0,0,.45);
}

.btn {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--pixel); font-size: 15px;
  padding: 12px 20px;
  background: var(--accent, var(--yellow));
  color: #14112b;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--accent, var(--yellow)),
    0 var(--px) 0 0 var(--accent, var(--yellow)),
    0 calc(var(--px) * 2) 0 0 #000;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active {
  transform: translateY(var(--px));
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--accent, var(--yellow)),
    0 var(--px) 0 0 var(--accent, var(--yellow)),
    0 var(--px) 0 0 #000;
}
.btn:focus-visible, a:focus-visible { outline: 3px dashed var(--cyan); outline-offset: 6px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px max(16px, (100% - 1120px) / 2);
  background: rgba(11, 13, 26, .72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo { font-size: 20px; color: var(--yellow); }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav nav { display: flex; gap: 22px; font-size: 15px; color: var(--muted); }
.nav nav a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: clamp(72px, 14vh, 140px) 0 80px; }
.kicker { color: var(--cyan); font-size: 15px; margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(34px, 6.4vw, 68px);
  line-height: 1.18; font-weight: 800; letter-spacing: -.03em;
}
.grad {
  background: linear-gradient(90deg, var(--yellow), var(--pink) 50%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin-top: 22px; font-size: clamp(16px, 2vw, 19px); color: var(--muted); }
.hero-cta { margin-top: 36px; }
.stats {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 64px;
}
.stats li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 16px; background: rgba(22, 26, 51, .7);
  border: 2px solid var(--line);
}
.stats b { font-size: 22px; color: var(--yellow); }
.stats span { font-size: 12px; color: var(--muted); }

/* ---------- section ---------- */
section { scroll-margin-top: 70px; }
.section-title {
  display: flex; flex-direction: column; gap: 4px;
  font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -.02em;
  margin-bottom: 48px;
}
.section-title .pixel { font-size: 14px; font-weight: 400; color: var(--pink); letter-spacing: .1em; }

/* ---------- project ---------- */
.project {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 64px);
  align-items: center; margin-bottom: clamp(80px, 12vw, 140px);
}
.project.reverse { grid-template-columns: 1fr 1.15fr; }
.project.reverse .cover { order: 2; }
.cover { display: block; overflow: hidden; transition: transform .25s; }
.cover:hover { transform: translateY(-6px); }
.cover img { width: 100%; height: auto; image-rendering: pixelated; }

.stage { color: var(--accent); font-size: 13px; margin-bottom: 8px; }
.info h3 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.desc { color: var(--muted); font-size: 16.5px; }
.points { margin: 20px 0; display: grid; gap: 8px; font-size: 15px; }
.points li { padding-left: 22px; position: relative; }
.points li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 8px; height: 8px; background: var(--accent);
  box-shadow: 2px 2px 0 rgba(0,0,0,.5);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.tags li {
  font-size: 12.5px; padding: 3px 10px;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* 꼬리 게이지 */
.tails { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 12px; color: var(--muted); }
.tail-bar { display: flex; gap: 4px; }
.tail-bar i {
  width: 16px; height: 16px; background: #2a2f55;
  animation: tail 6s steps(1) infinite;
}
.tail-bar i:nth-child(1) { animation-delay: 0s; }
.tail-bar i:nth-child(2) { animation-delay: .5s; }
.tail-bar i:nth-child(3) { animation-delay: 1s; }
.tail-bar i:nth-child(4) { animation-delay: 1.5s; }
.tail-bar i:nth-child(5) { animation-delay: 2s; }
.tail-bar i:nth-child(6) { animation-delay: 2.5s; }
.tail-bar i:nth-child(7) { animation-delay: 3s; }
.tail-bar i:nth-child(8) { animation-delay: 3.5s; }
.tail-bar i:nth-child(9) { animation-delay: 4s; }
@keyframes tail {
  0% { background: #2a2f55; box-shadow: none; }
  10%, 90% { background: var(--yellow); box-shadow: inset -4px -4px 0 #d99a1c; }
}

/* Escape Sea 커버 연출 */
.sea { aspect-ratio: 1200 / 630; }
.sea .sea-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: auto;
}
.o2 {
  position: absolute; top: 14px; left: 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #fff; text-shadow: 2px 2px 0 #000;
}
.o2-bar { width: 120px; height: 14px; border: 3px solid #fff; background: rgba(0,0,0,.4); box-shadow: 2px 2px 0 #000; }
.o2-bar i { display: block; height: 100%; background: var(--cyan); animation: o2 4s steps(16) infinite; }
@keyframes o2 { 0% { width: 100%; } 85% { width: 8%; background: #ff5d6c; } 86%, 100% { width: 100%; } }
.sea-title {
  position: absolute; top: 12px; right: 16px;
  font-size: clamp(14px, 2vw, 20px); color: #fff; text-shadow: 3px 3px 0 #0a2a6b;
}

/* 가계부: 브라우저 창 프레임 */
.browser {
  border-radius: 12px; background: #fff;
  box-shadow: 0 30px 60px -20px rgba(80, 60, 220, .55), 0 0 0 1px rgba(255,255,255,.08);
}
.browser .browser-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: #ecebf5;
}
.browser-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff6159; }
.browser-bar i:nth-child(2) { background: #ffbd2e; }
.browser-bar i:nth-child(3) { background: #28c941; }
.browser-bar span {
  margin-left: 10px; flex: 1; max-width: 260px;
  font-size: 12px; color: #6b6b85; background: #fff; border-radius: 6px; padding: 2px 10px;
}
.browser img { image-rendering: auto; }

/* ---------- about ---------- */
.about-card {
  display: grid; grid-template-columns: auto 1fr; gap: 32px;
  padding: clamp(24px, 4vw, 40px); color: var(--muted);
}
.avatar {
  width: 112px; height: 112px; background: #0f1226; padding: 8px;
  border: 4px solid var(--line);
}
.avatar canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.about-name { font-size: 22px; color: var(--text); margin-bottom: 10px; }
.lv { font-size: 13px; color: var(--yellow); margin-left: 8px; }
.skills { margin-top: 22px; display: grid; gap: 10px; font-size: 15px; }
.skills .pixel {
  display: inline-block; width: 58px; margin-right: 10px;
  font-size: 12px; color: var(--cyan);
}

/* ---------- footer ---------- */
.footer { padding: 110px 0 48px; text-align: center; color: var(--muted); font-size: 14px; }
.footer .pixel { color: var(--yellow); font-size: 16px; margin-bottom: 8px; animation: blink 1.4s steps(1) infinite; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .7s ease, transform .7s ease; }
.reveal.on { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .project, .project.reverse { grid-template-columns: 1fr; }
  .project.reverse .cover { order: 0; }
  .about-card { grid-template-columns: 1fr; }
  .avatar { width: 88px; height: 88px; }
}
@media (max-width: 420px) {
  .nav nav { gap: 14px; }
  .o2-bar { width: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
