*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #0a0e2a; /* 로고 바탕의 밤하늘 남색 */
  --ink-soft: #464d6b;
  --muted: #8a91a8;
  --line: #e3e6ee;
  --paper: #ffffff;
  --paper-soft: #f6f7fb;
  --navy: #1e2c68;
  --blue: #3d7bff; /* 로고의 ㅇ */
  --blue-light: #7cd2ff;
  --coral: #f0466a; /* 로고의 ㅣ */
  --coral-light: #ff9b8e;
  --radius: 16px;
  --dock: 56px;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue);
}

code {
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border: 1px solid #d5d9e4;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.85em;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- 첫 화면 (intro.js) — 로고·삼각형을 그리는 캔버스가 화면을 덮는다. 클릭은 지나간다 */

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

html.intro,
html.intro body {
  overflow: hidden;
}

/* 첫 화면 동안 사이트는 숨는다 — ㅇ 안으로 들어갈 때(diving) 캔버스 밑에서 보이기 시작한다 */
html.intro:not(.diving) .site {
  visibility: hidden;
}

/* ---- 독 — 맨 위에 붙은 막대: 로고·이름, 메뉴. 아래는 화면 끝까지 가는 선 */

.dock {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--dock);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.dock-nav {
  display: flex;
  align-items: center;
  gap: 40px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dock-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

/* 가리키면 로고의 파랑, 아래에 얇은 줄 — 지금 보고 있는 부분도 */
.dock-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.2s;
}

.dock-nav a:hover,
.dock-nav a:focus-visible,
.dock-nav a[aria-current="page"] {
  color: var(--blue);
}

.dock-nav a:hover::after,
.dock-nav a:focus-visible::after,
.dock-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.dock-nav a:focus-visible {
  outline: none;
}

/* ---- 단추 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.button:hover {
  border-color: #c9cfdd;
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--blue-light), var(--blue));
  /* 그라데이션을 테두리 칸까지 한 장으로 — 기본(padding-box에서 되풀이)이면 투명한 1px 테두리에 아래 끝의 진한 파랑이
     다시 나와 단추 위쪽에 줄이 보였다 */
  background-origin: border-box;
  background-repeat: no-repeat;
  color: #fff;
  box-shadow: 0 8px 22px rgba(61, 123, 255, 0.32);
}

.button.primary:hover {
  box-shadow: 0 10px 28px rgba(61, 123, 255, 0.42);
}

.button.disabled {
  border-style: dashed;
  color: var(--muted);
  cursor: default;
}

.button.disabled:hover {
  transform: none;
  border-color: var(--line);
}

/* ---- 칸들 */

main {
  display: block;
  padding-bottom: 96px; /* 맺음말을 뺐다 (사용자 2026-10-15) — 끝이 화면 바닥에 붙지 않게 */
}

.section,
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding-top: 104px;
}

section[id],
article[id] {
  scroll-margin-top: calc(var(--dock) + 24px);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
}

.section-lead {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 17px;
}

/* 다른 페이지의 머리 (다운로드·매뉴얼·소스코드) */

.page-head {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px 0;
}

.page-head h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section.tight {
  padding-top: 8px;
}

.not-found {
  min-height: 50vh;
}

.not-found .actions {
  justify-content: flex-start;
}

/* 소개 */

.hero {
  padding-top: 88px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(36px, 6.4vw, 68px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.lead {
  max-width: 680px;
  margin: 22px auto 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 19px);
}

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.screenshot {
  margin: 64px 0 0;
}

.screenshot img {
  display: block;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(10, 14, 42, 0.08), 0 30px 80px rgba(10, 14, 42, 0.22);
}

.screenshot figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

/* 특징 */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.feature {
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.feature h3 {
  margin-top: 18px;
  font-size: 19px;
}

.feature p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* 로고의 두 획 — ㅇ 고리와 ㅣ 막대 */
.mark {
  display: block;
}

.mark.ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 6px solid var(--blue);
  border-top-color: var(--blue-light);
  border-left-color: var(--blue-light);
}

.mark.bar {
  width: 8px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--coral-light), var(--coral));
}

/* 테마 */

.themes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.themes li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.themes img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* 다운로드 */

.downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.download {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--paper-soft));
}

.download h2 {
  font-size: 22px;
}

.download h2 span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.download .kind {
  margin: 4px 0 0;
  color: var(--blue);
  font-weight: 600;
}

.download ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 15px;
}

.download .file {
  margin: 18px 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
}

.download .button {
  margin-top: auto;
  align-self: flex-start;
}

.note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* 매뉴얼 */

.manual-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  margin-top: 32px;
}

.manual-toc ol {
  position: sticky;
  top: calc(var(--dock) + 24px);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.manual-toc li {
  counter-increment: toc;
}

.manual-toc a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  text-decoration: none;
}

.manual-toc a::before {
  content: counter(toc) ". ";
  color: var(--muted);
}

.manual-toc a:hover,
.manual-toc a[aria-current="true"] {
  background: var(--paper-soft);
  color: var(--ink);
}

.manual-body article + article {
  margin-top: 56px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}

.manual-body h2 {
  font-size: 24px;
  font-weight: 800;
}

.manual-body h3 {
  margin-top: 28px;
  font-size: 17px;
}

.manual-body p,
.manual-body li {
  color: var(--ink-soft);
  font-size: 16px;
}

.manual-body > article > p {
  margin: 14px 0 0;
}

.steps {
  margin: 14px 0 0;
  padding-left: 22px;
}

.steps li + li {
  margin-top: 6px;
}

.tip {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--blue-light);
  border-radius: 0 10px 10px 0;
  background: var(--paper-soft);
  font-size: 15px !important;
}

.plain {
  margin: 14px 0 0;
  padding-left: 20px;
}

.plain li + li {
  margin-top: 8px;
}

table.keys {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 15px;
}

table.keys th,
table.keys td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

table.keys th {
  width: 42%;
  padding-right: 16px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

table.keys td {
  color: var(--ink-soft);
}

/* GPL 부분의 소스코드 */

.prose {
  max-width: 760px;
  margin-top: 20px;
}

.prose p,
.prose li {
  color: var(--ink-soft);
  font-size: 16px;
}

.table-tools {
  margin-top: 32px;
}

.search input {
  width: min(360px, 100%);
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.search input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.18);
}

.table-count {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  max-height: 560px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table.packages {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.packages th,
table.packages td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

table.packages thead th {
  position: sticky;
  top: 0;
  background: var(--paper-soft);
  color: var(--ink-soft);
  font-weight: 600;
}

table.packages tbody tr:hover {
  background: #fafbfe;
}

table.packages td:nth-child(3) {
  white-space: normal;
  min-width: 220px;
}

table.packages a {
  text-decoration: none;
}

table.packages a:hover {
  text-decoration: underline;
}

/* ---- 좁은 화면 */

@media (max-width: 960px) {
  .features,
  .themes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manual-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .manual-toc ol {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .dock {
    gap: 20px;
    padding: 0 16px;
  }

  .dock-nav {
    gap: 20px;
  }

  .brand span {
    display: none;
  }

  .section,
  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .section {
    padding-top: 72px;
  }

  .features,
  .themes,
  .downloads {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head {
    padding: 48px 16px 0;
  }

  table.keys th {
    width: auto;
    white-space: normal;
  }
}

/* ---- 다운로드: 올린 파일 확인 표 */
h2.sub {
  margin: 40px 0 0;
  font-size: 22px;
}

table.files td:nth-child(2) {
  white-space: nowrap;
}

table.files td:nth-child(3) {
  color: var(--ink-soft);
}

code.hash {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 12px;
}
