:root {
  --bg: #000000;
  --line: rgb(255 255 255 / 0.09);
  --line-strong: rgb(255 255 255 / 0.18);
  --text: #ffffff;
  --body: #c9c9c9;
  --muted: #9a9a9a;
  --faint: #6a6a6a;
  --accent: #ffd60a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

::selection {
  color: var(--bg);
  background: var(--accent);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family:
    'Space Grotesk', 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.85;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  background: rgb(0 0 0 / 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navbar-brand {
  font-family: 'Sixtyfour', monospace;
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
  text-decoration: none;
  text-shadow:
    0 0 8px rgb(255 214 10 / 0.6),
    0 0 24px rgb(255 214 10 / 0.25);
}

.navbar-links,
.doc-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.navbar-links a,
.doc-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.navbar-links a:hover,
.doc-footer a:hover {
  color: var(--accent);
}

.doc {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(40px, 10svh, 96px) max(20px, env(safe-area-inset-right)) 72px
    max(20px, env(safe-area-inset-left));
}

.doc h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

.doc-lead {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.doc-back {
  display: inline-block;
  margin-bottom: 22px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.3s ease;
}

.doc-back:hover {
  color: var(--accent);
}

.doc-list {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.doc-list li {
  border-bottom: 1px solid var(--line);
}

.doc-list a {
  display: block;
  padding: 24px 0;
  text-decoration: none;
}

.doc-list h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  transition: color 0.3s ease;
}

.doc-list a:hover h2 {
  color: var(--accent);
}

.doc-list p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}

.prose {
  margin-top: 40px;
}

.prose > * {
  margin: 0;
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose h2 {
  margin-top: 2.6em;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.prose h3 {
  margin-top: 2em;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
}

.prose strong {
  font-weight: 500;
  color: var(--text);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgb(255 214 10 / 0.4);
  text-underline-offset: 3px;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li::marker {
  color: var(--faint);
}

.prose blockquote {
  padding-left: 1em;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
}

.prose code {
  padding: 0.15em 0.4em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--text);
  background: rgb(255 255 255 / 0.08);
  border-radius: 6px;
}

.prose pre {
  padding: 1em 1.15em;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  background: rgb(255 255 255 / 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.prose pre code {
  padding: 0;
  font-size: inherit;
  color: var(--body);
  background: none;
}

.prose table {
  width: 100%;
  font-size: 14.5px;
  line-height: 1.65;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.7em 0.9em 0.7em 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.prose th {
  font-weight: 500;
  color: var(--text);
}

.doc-next {
  display: block;
  margin-top: 56px;
  padding: 18px 20px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.4s ease;
}

.doc-next:hover {
  border-color: var(--line-strong);
}

.doc-next span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.doc-next strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
}

.doc-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
}

.doc-footer p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

@media (max-width: 600px) {
  .navbar {
    height: 44px;
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }

  .prose table {
    font-size: 13.5px;
  }
}
