/* =========================================================
   Play Maker Lite Docs — 서브컬처 창작자 친화 디자인
   ========================================================= */
:root {
  --ink: #2A2140;
  --ink-soft: #4D4466;
  --ink-mute: #8E85A3;
  --paper: #FDFBF7;
  --paper-2: #F7F1EA;
  --card: #FFFFFF;
  --line: #EDE6DF;
  --line-soft: #F3EDE6;
  --accent: #7C5CFF;
  --accent-soft: #EEE8FF;
  --accent-deep: #5A3EE8;
  --peach: #FF8FA3;
  --peach-soft: #FFE4EA;
  --mint: #6FD1B8;
  --mint-soft: #E1F7F0;
  --butter: #FFD27A;
  --butter-soft: #FFF1D6;
  --shadow-sm: 0 1px 2px rgba(50, 30, 90, 0.04), 0 2px 6px rgba(50, 30, 90, 0.05);
  --shadow-md: 0 4px 10px rgba(50, 30, 90, 0.06), 0 10px 30px rgba(50, 30, 90, 0.08);
  --shadow-lg: 0 12px 40px rgba(50, 30, 90, 0.15);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --sidebar-w: 272px;
  --topbar-h: 60px;
  --font: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'ss01' on, 'ss03' on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.65;
}
body.no-scroll { overflow: hidden; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { color: var(--accent); }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #FFFFFF 0%, #FDFAF5 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 18px 16px;
  overflow-y: auto;
  z-index: 40;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-block;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7C5CFF 0%, #FF8FA3 100%);
  box-shadow: 0 4px 10px rgba(124, 92, 255, 0.35);
  position: relative;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 4px;
  background: #fff;
  opacity: 0.85;
}
.sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}
.sidebar-close:hover { background: var(--paper-2); }
.sidebar-nav {
  flex: 1;
  padding: 4px 0;
}
.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  font-weight: 700;
  margin: 18px 10px 6px;
}
.nav-section:first-child { margin-top: 4px; }
.sidebar-nav a {
  display: block;
  padding: 7px 12px;
  color: var(--ink-soft);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin: 1px 0;
}
.sidebar-nav a:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.sidebar-nav a.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}
.sidebar-footer {
  padding: 14px 10px 6px;
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.sidebar-footer .hint {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
  line-height: 1.5;
}
.sidebar-footer strong {
  color: var(--accent-deep);
  font-weight: 700;
}
.sidebar-scrim {
  position: fixed; inset: 0;
  background: rgba(40, 25, 70, 0.35);
  backdrop-filter: blur(2px);
  z-index: 35;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar-scrim.is-open { opacity: 1; }

/* ===== Main layout ===== */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.hamburger {
  display: none;
  background: none; border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.hamburger:hover { background: var(--paper-2); }
.topbar-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-home .topbar-title { display: none; }
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-mute);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 240px;
  box-shadow: var(--shadow-sm);
}
.search-trigger:hover {
  border-color: var(--accent);
  background: #fff;
}
.search-trigger-label {
  flex: 1;
  text-align: left;
}
.search-trigger kbd, .esc-hint {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  background: var(--paper-2);
  color: var(--ink-soft);
  border-radius: 5px;
  border: 1px solid var(--line);
}

/* ===== Content ===== */
.content {
  flex: 1;
  padding: 48px 64px 80px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}
.doc h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--ink);
  line-height: 1.25;
}
.doc h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 40px 0 12px;
  color: var(--ink);
  padding-top: 6px;
}
.doc h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--ink);
}
.doc p {
  margin: 14px 0;
  color: var(--ink-soft);
  font-size: 15.5px;
}
.doc strong { color: var(--ink); font-weight: 700; }
.doc em { color: var(--ink-soft); }
.doc ul, .doc ol {
  margin: 14px 0 14px 4px;
  padding-left: 22px;
}
.doc li {
  margin: 6px 0;
  color: var(--ink-soft);
  font-size: 15.5px;
}
.doc li::marker { color: var(--accent); }
.doc code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 2px 6px;
  border-radius: 6px;
}
.doc pre {
  background: #1F1836;
  color: #EEE8FF;
  padding: 18px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: var(--shadow-md);
}
.doc pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.doc .table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
}
.doc th, .doc td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.doc th {
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
}
.doc tr:last-child td { border-bottom: none; }
.doc tr:hover td { background: rgba(236, 232, 255, 0.25); }
.doc figure {
  margin: 28px 0;
}
.doc figure img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.doc figcaption {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 8px;
  text-align: center;
}
.doc a { border-bottom: 1px dashed var(--accent-soft); }
.doc a:hover { border-bottom-color: var(--accent); }

/* ===== Prev/Next ===== */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.pn-link {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.pn-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.pn-next { text-align: right; }
.pn-label {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.pn-title {
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  margin-top: 4px;
}
.pn-prev::before { content: '←  '; color: var(--ink-mute); }
.pn-next .pn-title::after { content: '  →'; color: var(--ink-mute); }
.pn-spacer { }

/* ===== Home (Hero) ===== */
.content-home {
  max-width: 960px;
  padding: 40px 56px 80px;
}
.hero {
  padding: 56px 0 40px;
  text-align: left;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 20px; right: -40px;
  width: 360px; height: 360px;
  background: radial-gradient(circle at center, rgba(255, 143, 163, 0.25) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  filter: blur(30px);
}
.hero::after {
  content: '';
  position: absolute;
  top: 200px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle at center, rgba(124, 92, 255, 0.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  filter: blur(30px);
}
.hero-badge {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 20px;
}
.hero-accent {
  background: linear-gradient(120deg, #7C5CFF 0%, #FF8FA3 60%, #FFD27A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.65;
  margin-bottom: 28px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 20px rgba(42, 33, 64, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
  color: #fff;
  box-shadow: 0 10px 30px rgba(90, 62, 232, 0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: #fff;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.chip:nth-child(1) { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; }
.chip:nth-child(2) { background: var(--peach-soft); color: #C5485C; border-color: transparent; }
.chip:nth-child(3) { background: var(--mint-soft); color: #2B8C72; border-color: transparent; }
.chip:nth-child(4) { background: var(--butter-soft); color: #9A6E1F; border-color: transparent; }

.home-section {
  margin-top: 40px;
}
.home-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.home-card {
  position: relative;
  padding: 22px 22px 50px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 130px;
}
.home-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.home-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.home-card-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.home-card-arrow {
  position: absolute;
  bottom: 16px; right: 18px;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.15s;
}
.home-card:hover .home-card-arrow { transform: translateX(4px); }

.home-tips {
  margin-top: 40px;
}
.tip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(120deg, var(--butter-soft) 0%, var(--peach-soft) 100%);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-soft);
}
.tip-k {
  flex-shrink: 0;
  padding: 4px 10px;
  background: #fff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
}
.tip-body kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin: 0 2px;
}

/* ===== Search modal ===== */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 20, 50, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 20px;
  opacity: 0;
  transition: opacity 0.18s;
}
.search-overlay.is-open { opacity: 1; }
.search-modal {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.97);
  transition: transform 0.18s;
}
.search-overlay.is-open .search-modal { transform: scale(1); }
.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-mute);
}
#search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
}
#search-input::placeholder { color: var(--ink-mute); }
.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
}
.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 14px;
}
.search-empty span { color: var(--ink-mute); font-size: 13px; opacity: 0.8; }
.search-list {
  list-style: none;
  padding: 0; margin: 0;
}
.search-list li { padding: 0; }
.search-hit {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s;
  border: none !important;
}
.search-hit:hover { background: var(--accent-soft); color: var(--ink); }
.search-hit-section {
  display: block;
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.search-hit-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.search-hit-snippet {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.5;
}
.search-hit mark {
  background: var(--butter-soft);
  color: var(--ink);
  padding: 0 2px;
  border-radius: 3px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .main { margin-left: 0; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 86vw; max-width: 320px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .search-trigger { min-width: auto; }
  .search-trigger-label { display: none; }
  .content { padding: 28px 20px 60px; }
  .content-home { padding: 24px 20px 60px; }
  .hero { padding: 32px 0 24px; }
  .hero-title { font-size: 38px; }
  .hero-sub { font-size: 16px; }
  .doc h1 { font-size: 26px; }
  .doc h2 { font-size: 19px; }
  .prev-next { grid-template-columns: 1fr; }
  .search-overlay { padding-top: 6vh; }
}
@media (max-width: 480px) {
  .search-trigger { padding: 8px 10px; }
  .search-trigger kbd { display: none; }
  .hero-title { font-size: 32px; }
  .btn { padding: 10px 16px; font-size: 14px; width: 100%; justify-content: center; }
  .hero-cta { flex-direction: column; }
}
