/* ViewWork — homepage styles
 *
 * Single CSS file for the public site. Mobile-first, dark-mode-first to match the app.
 * Variables align with the Electron renderer (src/styles/index.css) so screenshots and
 * marketing site share the same accent palette.
 *
 * Performance:
 *  - body 에는 fixed gradient 만 (스크롤 시 re-paint 방지 — `background-attachment: fixed`)
 *  - 모든 섹션 `content-visibility: auto` — 스크롤 위치 밖 섹션은 layout 계산 skip
 *  - 호버 효과 transform-only (no width/height/box-shadow 재계산)
 *  - GPU 가속: `will-change: transform` 은 호버되는 카드에만 (메모리 over-allocation 회피)
 *  - 사용자가 reduced-motion 선호 시 모든 transition / hero animation 정지
 */

:root {
  --bg-base: #0b0e14;
  --bg-surface: #11151d;
  --bg-elevated: #1a1f2a;
  --bg-hover: #222936;
  --border-subtle: #2a3142;
  --border-default: #384154;
  --text-primary: #e6eaf2;
  --text-secondary: #9aa4b8;
  --text-muted: #5c667a;
  --accent: #5b8def;
  --accent-glow: #7aaeff;
  --accent-warning: #f5a623;
  --accent-success: #3ddc84;
  --accent-danger: #ff4d6d;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Pretendard",
    "Noto Sans KR", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-base);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  /*
   * background-attachment: fixed — 스크롤 시 gradient 가 다시 그려지지 않음 (큰 perf 이득).
   * 단색 base + 두 radial gradient (블루 hero / 퍼플 footer) 만으로 시각적 깊이 유지.
   */
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(91, 141, 239, 0.16), transparent 70%) fixed,
    radial-gradient(ellipse 70% 50% at 90% 110%, rgba(167, 139, 250, 0.10), transparent 70%) fixed,
    var(--bg-base);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 사용자가 reduced-motion 선호 시 모든 transition / animation 끔 (접근성 + 성능) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

a {
  color: var(--accent-glow);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ─── header ─────────────────────────────────────────────── */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(11, 14, 20, 0.72);
  border-bottom: 1px solid var(--border-subtle);
}
header.site-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.logo .mark {
  /* 새 로고 SVG 가 자체 다크 배경 + 트라이앵글 노드를 포함 — span 은 wrapper 만. */
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #1e2532 0%, #0e1118 60%, #07090f 100%);
  box-shadow: 0 4px 14px rgba(91, 141, 239, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.logo .mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.logo .name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.logo .ver {
  margin-left: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
nav.primary {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
nav.primary a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
nav.primary a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
}
nav.primary a.lang {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  border: 1px solid var(--border-subtle);
}
nav.primary a.lang.active {
  border-color: var(--accent);
  color: var(--accent-glow);
}

/* ─── hero ───────────────────────────────────────────────── */
section.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  background: linear-gradient(135deg, #e6eaf2 0%, #7aaeff 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .tagline {
  font-size: clamp(16px, 2vw, 22px);
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto 36px;
  line-height: 1.55;
}
.hero .cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4c7ddf);
  color: white;
  box-shadow: 0 4px 18px rgba(91, 141, 239, 0.45);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(91, 141, 239, 0.6);
  text-decoration: none;
}
.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}
.btn .mono {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.7;
}

/* ─── hero screenshot ────────────────────────────────────── */
.hero-shot {
  margin: 56px auto 0;
  max-width: 1100px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  background: var(--bg-surface);
  /* GPU 합성 레이어로 분리 — SVG 애니메이션 reflow 가 페이지의 다른 영역에 영향 X */
  contain: layout paint;
  isolation: isolate;
  transform: translateZ(0);
}
.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-shot.placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(91, 141, 239, 0.2), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(167, 139, 250, 0.15), transparent 60%),
    var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  flex-direction: column;
  gap: 8px;
}

/* ─── section common ────────────────────────────────────── */
section.block {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px;
  /*
   * content-visibility: auto — 화면 밖 섹션은 layout/paint 를 skip → 첫 페인트 가속.
   * contain-intrinsic-size 로 placeholder 높이 지정 → 스크롤바가 안 흔들림.
   */
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}
/* 히어로는 항상 가시 영역 — content-visibility 적용 X */
section.hero,
section.block:first-of-type {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}
section.block h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
section.block .lead {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 720px;
  line-height: 1.6;
  margin: 0 0 40px;
}

/* ─── feature grid ──────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.feature {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  /* 호버 시 transform 만 변경 — GPU 합성. layout/paint 재계산 회피. */
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature:hover {
  border-color: var(--accent);
  transform: translate3d(0, -2px, 0);
  will-change: transform;
}
.feature .icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(91, 141, 239, 0.12);
  color: var(--accent-glow);
  font-size: 18px;
  margin-bottom: 14px;
}
.feature h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}
.feature p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 14px;
}

/* ─── how it works (steps) ──────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  counter-reset: step-counter;
}
.step {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px 20px;
  position: relative;
}
.step::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.25;
}
.step h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}
.step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

/* ─── screenshot row ────────────────────────────────────── */
.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.screenshot {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}
.screenshot img,
.screenshot .placeholder-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(91, 141, 239, 0.06) 0,
      rgba(91, 141, 239, 0.06) 10px,
      transparent 10px,
      transparent 20px
    ),
    var(--bg-elevated);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
}
.screenshot .caption {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

/* ─── download section ──────────────────────────────────── */
.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.dl-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px 20px;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.dl-card:hover {
  border-color: var(--accent);
  transform: translate3d(0, -2px, 0);
  will-change: transform;
}
.dl-card .platform {
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.dl-card h3 {
  font-size: 18px;
  margin: 0 0 14px;
}
.dl-card .ver-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  font-family: var(--font-mono);
}

/* ─── patch notes ───────────────────────────────────────── */
.release-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.release {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px 24px;
}
.release-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.release-head .ver {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-glow);
}
.release-head .date {
  font-size: 12px;
  color: var(--text-muted);
}
.release-head .badge {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(61, 220, 132, 0.15);
  color: var(--accent-success);
}
.release-head .badge.draft {
  background: rgba(245, 166, 35, 0.15);
  color: var(--accent-warning);
}
.release-body {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}
.release-body ul {
  margin: 0;
  padding-left: 22px;
}
.release-body li {
  margin: 4px 0;
}
.release-body code {
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--accent-glow);
}

/* ─── footer ────────────────────────────────────────────── */
footer.site-footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 64px;
  padding: 48px 24px 32px;
  background: rgba(11, 14, 20, 0.6);
}
footer.site-footer .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}
footer h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-weight: 600;
}
footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
footer ul li {
  margin: 6px 0;
}
footer ul li a {
  color: var(--text-secondary);
  font-size: 14px;
}
footer ul li a:hover {
  color: var(--text-primary);
}
footer .copyright {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── inline kbd ─────────────────────────────────────────── */
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

/* ─── blog article ───────────────────────────────────────── */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
}
.article .meta {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.article h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #e6eaf2 0%, #7aaeff 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.article .lede {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 36px;
  border-left: 3px solid var(--accent);
  padding-left: 18px;
}
.article h2 {
  font-size: 26px;
  margin: 56px 0 14px;
  letter-spacing: -0.01em;
}
.article h3 {
  font-size: 19px;
  margin: 32px 0 10px;
  color: var(--accent-glow);
}
.article p {
  margin: 16px 0;
  color: var(--text-primary);
}
.article p.muted {
  color: var(--text-secondary);
  font-size: 15px;
}
.article ul,
.article ol {
  margin: 14px 0;
  padding-left: 26px;
}
.article li {
  margin: 6px 0;
  color: var(--text-primary);
}
.article code {
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--accent-glow);
  font-family: var(--font-mono);
}
.article pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 22px 0;
}
.article pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}
.article blockquote {
  border-left: 4px solid var(--accent);
  margin: 26px 0;
  padding: 6px 22px;
  color: var(--text-secondary);
  background: rgba(91, 141, 239, 0.06);
  border-radius: 0 10px 10px 0;
  font-style: italic;
}
.article figure {
  margin: 36px -8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.article figure img,
.article figure .placeholder-img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
}
.article figure figcaption {
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}
.article .toc {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 24px 0 32px;
}
.article .toc strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.article .toc ol {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
}
.article .toc li {
  margin: 4px 0;
}
.article hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 56px 0;
}

/* ─── small screens ─────────────────────────────────────── */
@media (max-width: 640px) {
  header.site-header .inner {
    flex-wrap: wrap;
  }
  nav.primary {
    width: 100%;
  }
  section.hero {
    padding-top: 56px;
  }
}
