/* 개인 프로젝트 데모 — 첫 화면. 바깥 글꼴 · 스크립트 없이 이 서버 파일만 쓴다(CSP default-src 'self'). */

:root {
  --bg: #f7f7f5;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --text: #1d1d1b;
  --muted: #5d5d58;
  --line: #dddcd6;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --accent-soft: #e8eefc;
  --ok: #1f8a4c;
  --bad: #c2412d;
  --wait: #9a9a92;
  --cloud: #fff1e2;
  --cloud-line: #f0b878;
  --db: #ecebf7;
  --db-line: #b3aedb;
  --app: #eaf4ee;
  --app-line: #a5cdb3;
  --web: #e8eefc;
  --web-line: #a8bcef;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --bg-alt: #1b1b1a;
    --surface: #222220;
    --surface-2: #2a2a28;
    --text: #ecebe6;
    --muted: #a9a8a0;
    --line: #3a3a37;
    --accent: #7c9cff;
    --accent-text: #0f1a3a;
    --accent-soft: #24304f;
    --ok: #4cc07c;
    --bad: #f07a63;
    --wait: #77776f;
    --cloud: #3a2c1c;
    --cloud-line: #8a6232;
    --db: #2a2840;
    --db-line: #5d5791;
    --app: #1f3227;
    --app-line: #4b7c5d;
    --web: #24304f;
    --web-line: #4f68a8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
strong { font-weight: 700; }
q { quotes: "「" "」"; font-weight: 600; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--accent-text);
  padding: 8px 12px; border-radius: 8px; z-index: 10;
}
.skip:focus { left: 8px; }

/* 머리 */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.brand { font-weight: 700; white-space: nowrap; }
.top-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}
.top-nav a:hover, .top-nav a:focus-visible { background: var(--surface-2); color: var(--text); }
@media (max-width: 560px) { .brand { display: none; } .top-row { justify-content: flex-start; } }

/* 첫 부분 */
.hero { padding: 56px 0 40px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.25; margin: 0 0 16px; letter-spacing: -.02em; }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); margin: 0 0 20px; max-width: 46em; }
.lead strong { color: var(--text); }
.facts { margin: 0 0 24px; padding-left: 20px; color: var(--muted); max-width: 50em; }
.facts li + li { margin-top: 4px; }

.status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); width: fit-content; max-width: 100%;
}
.status-title { font-weight: 700; margin-right: 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border-radius: 999px; padding: 3px 12px; font-size: 14px;
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--wait); }
.badge b { font-weight: 600; color: var(--muted); }
.badge.ok i { background: var(--ok); }
.badge.ok b { color: var(--ok); }
.badge.bad i { background: var(--bad); }
.badge.bad b { color: var(--bad); }
.status-time { font-size: 13px; color: var(--muted); }
.status-note { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

/* 프로젝트 */
.project { padding: 56px 0; border-top: 1px solid var(--line); scroll-margin-top: 52px; }
.project.alt { background: var(--bg-alt); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.project h2 { font-size: clamp(24px, 3.6vw, 34px); line-height: 1.3; margin: 0 0 14px; letter-spacing: -.015em; }
.project h2 span { display: block; font-size: .55em; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.project h3 { font-size: 19px; margin: 36px 0 12px; }
.summary { font-size: 17px; max-width: 48em; margin: 0 0 20px; }

.try { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  min-height: 44px;
}
.button small { font-weight: 500; color: var(--muted); font-size: 13px; }
.button:hover, .button:focus-visible { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover, .button.primary:focus-visible { filter: brightness(1.08); }
.button.off { pointer-events: none; opacity: .55; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 8px; max-width: 48em; }

.grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 860px) { .grid.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.grid.text p { margin: 0 0 12px; }

.steps { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 10px; }
.note {
  font-size: 15px; color: var(--muted);
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 16px 0 0;
}

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.cards li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.cards h4 { margin: 0 0 6px; font-size: 16px; }
.cards p { margin: 0; color: var(--muted); font-size: 15px; }

.shot { margin: 0; }
.shot img { border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.shot.phone { max-width: 300px; justify-self: center; }
.shot.wide { margin-top: 32px; }
.phones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.phones .shot.phone { max-width: none; }

.stack {
  display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px;
  margin: 32px 0 0; padding: 16px 20px; border-radius: var(--radius);
  background: var(--surface-2); font-size: 15px;
}
.stack dt { font-weight: 700; }
.stack dd { margin: 0; color: var(--muted); }
@media (max-width: 520px) {
  .stack { grid-template-columns: 1fr; }
  .stack dd { margin-bottom: 6px; }
}

.plain { margin: 0 0 12px; padding-left: 20px; }
.plain li { margin-bottom: 6px; }

/* 서버 구성도 — 그림 대신 상자로 그려 좁은 화면에서도 읽힌다 */
.flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 8px 0 32px; }
.node {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  background: var(--surface); text-align: center; font-weight: 600; font-size: 15px;
}
.node small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.node.outside { align-self: center; min-width: 220px; }
.node.cloud { align-self: center; min-width: 280px; background: var(--cloud); border-color: var(--cloud-line); }
.node.tunnel { background: var(--cloud); border-color: var(--cloud-line); margin-bottom: 12px; }
.node.web { background: var(--web); border-color: var(--web-line); }
.node.app { background: var(--app); border-color: var(--app-line); }
.node.db { background: var(--db); border-color: var(--db-line); }
.arrow {
  align-self: center; position: relative; height: 44px; width: 2px; background: var(--line);
  display: flex; align-items: center;
}
.arrow::after {
  content: ""; position: absolute; bottom: -1px; left: -5px;
  border: 6px solid transparent; border-top-color: var(--line); border-bottom: 0;
}
.arrow span {
  position: absolute; left: 12px; white-space: nowrap; font-size: 13px; color: var(--muted);
}
.box { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 14px; margin-top: 6px; }
.box-title { margin: 0 0 10px; font-weight: 700; text-align: center; }
.lanes { display: grid; gap: 12px; }
@media (min-width: 760px) { .lanes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .lanes { grid-template-columns: .7fr 1fr 1fr 1fr; } }
.lane { display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.lane-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); text-align: center; }

/* 바닥 */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 6px; }
.build { font-size: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 화면 모음 — 폰 화면 둘과 넓은 화면 하나 */
.gallery { display: grid; gap: 14px; margin-top: 32px; grid-template-columns: 1fr 1fr; align-items: start; }
.gallery .shot:last-child { grid-column: 1 / -1; }
@media (min-width: 860px) {
  .gallery { grid-template-columns: 1fr 1fr 2.05fr; }
  .gallery .shot:last-child { grid-column: auto; }
}

/* 넓은 화면 둘을 나란히(커머스 AI) */
.gallery.pair { grid-template-columns: 1fr; }
.gallery.pair .shot:last-child { grid-column: auto; }
@media (min-width: 720px) { .gallery.pair { grid-template-columns: 1fr 1fr; } }
