:root {
  --bg: #f5f3ef;
  --bg2: #ffffff;
  --bg3: #f0ede8;
  --bg4: #e8e4dd;
  --surface: #ffffff;
  --border: #e2ddd6;
  --border2: #ccc7be;
  --text: #1a1714;
  --text2: #5a5650;
  --text3: #9a9590;
  --acc: #c4693a;
  --acc2: #a8562e;
  --acc-bg: rgba(196, 105, 58, 0.08);
  --acc-bg2: rgba(196, 105, 58, 0.15);
  --green: #2d7d52;
  --green-bg: rgba(45, 125, 82, 0.08);
  --yellow: #a06820;
  --yellow-bg: rgba(160, 104, 32, 0.08);
  --blue: #2660a4;
  --blue-bg: rgba(38, 96, 164, 0.08);
  --coral: #c0392b;
  --coral-bg: rgba(192, 57, 43, 0.08);
  --amber: #7a5800;
  --amber-bg: rgba(122, 88, 0, 0.09);
  --sidebar-w: 280px;
  --topbar-h: 52px;
  --radius: 8px;
  --radius-lg: 12px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px 0 0;
  z-index: 100;
}
.topbar-brand {
  width: var(--sidebar-w);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  height: 100%;
  cursor: pointer;
}
.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--acc);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg {
  width: 14px;
  height: 14px;
  fill: white;
}
.brand-name {
  font-family: "DM Sans", serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.topbar-search {
  flex: 1;
  max-width: 380px;
  position: relative;
  margin: 0 20px;
}
.topbar-search input {
  width: 100%;
  height: 32px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 36px 0 34px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.topbar-search input:focus {
  border-color: var(--acc);
  background: var(--bg2);
}
.topbar-search input::placeholder {
  color: var(--text3);
}
.s-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.s-icon svg {
  width: 14px;
  height: 14px;
}
.s-kbd {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text3);
  background: var(--bg4);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
  font-family: "Fira Code", monospace;
}
.topbar-stats {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text3);
}
.topbar-stats strong {
  color: var(--text2);
  font-weight: 500;
}
.mob-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text2);
  margin-left: 8px;
}

/* layout */
.layout {
  display: flex;
  margin-top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}

/* sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  height: 100%;
  overflow-y: auto;
  flex-shrink: 0;
  padding-bottom: 40px;
  padding-top: 1rem;
}
.sidebar::-webkit-scrollbar {
  width: 3px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.sl {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 600;
  padding: 18px 18px 5px;
}
.nc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.12s;
  color: var(--text2);
  font-size: 15px;
  font-weight: 400;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nc:hover {
  background: var(--bg3);
  color: var(--text);
}
.nc.active {
  background: var(--acc-bg);
  color: var(--acc);
  font-weight: 500;
}
.ci {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--bg3);
}
.nc.active .ci {
  background: var(--acc-bg2);
}
.cl {
  flex: 1;
  text-align: left;
}
.cc {
  font-family: "Fira Code", monospace;
  font-size: 10px;
  color: var(--text3);
  background: var(--bg3);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.nc.active .cc {
  background: var(--acc-bg2);
  color: var(--acc);
}
.chev {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--text3);
  transition: transform 0.2s;
}
.nc.open .chev {
  transform: rotate(90deg);
}
.ns {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.ns.open {
  max-height: 600px;
}
.ni {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 46px;
  font-size: 14px;
  color: var(--text3);
  cursor: pointer;
  text-decoration: none;
  transition:
    color 0.12s,
    background 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.ni:hover {
  color: var(--acc);
  background: var(--acc-bg);
}
.ni.wip {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.ni::before {
  content: "";
  width: 12px;
  height: 1px;
  background: var(--border2);
  flex-shrink: 0;
}
.sn {
  font-family: "Fira Code", monospace;
  font-size: 10px;
  color: inherit;
  opacity: 0.65;
  min-width: 22px;
}
.wt {
  font-size: 9px;
  background: var(--amber-bg);
  color: var(--amber);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: auto;
  white-space: nowrap;
}

/* main */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 36px 40px 60px;
  min-width: 0;
}
.main > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.main.guide-mode > * {
  max-width: none;
  margin: 0;
}
.main::-webkit-scrollbar {
  width: 3px;
}
.main::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.main.guide-mode {
  padding: 0;
  overflow: hidden;
}

/* inline guide viewer */
.guide-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.guide-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 12px;
}
.guide-bar .bc {
  margin: 0;
}
.guide-newtab {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text2);
  text-decoration: none;
  font-size: 11px;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.guide-newtab:hover {
  border-color: var(--acc);
  color: var(--acc);
}
.guide-newtab svg {
  width: 11px;
  height: 11px;
}
.guide-iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg);
  display: block;
}

/* home */
.hero {
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acc);
  font-weight: 600;
  margin-bottom: 10px;
}
.htitle {
  font-family: "Fraunces", serif;
  font-size: 50px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.htitle em {
  color: var(--acc);
  font-style: italic;
}
.hsub {
  font-size: 18px;
  color: var(--text2);
  max-width: 700px;
  line-height: 1.65;
  margin-bottom: 24px;
}
.hsub span {
  font-weight: bold;
  font-style: italic;
  font-size: 20px;
}
.hstats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hstat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hstat-n {
  font-family: "Fraunces", serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
}
.hstat-l {
  font-size: 16px;
  color: var(--text3);
}
.hgroups {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.hgl {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ccg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ccard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  text-align: left;
}
.ccard:hover {
  border-color: var(--acc);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(196, 105, 58, 0.1);
}
.ccard-icon {
  font-size: 20px;
  margin-bottom: 8px;
}
.ccard-name {
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 9px;
  line-height: 16px;
}
.ccard-ct {
  font-size: 14px;
  color: var(--text3);
}

/* topic */
.thead {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.bc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 12px;
}
.bc a {
  color: var(--text3);
  text-decoration: none;
  cursor: pointer;
}
.bc a:hover {
  color: var(--acc);
}
.bc-s {
  color: var(--border2);
}
.ttitle {
  font-family: "Fraunces", serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.tdesc {
  font-size: 13px;
  color: var(--text3);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 6px;
}
.tmeta {
  font-size: 12px;
  color: var(--text3);
}
.notice {
  background: var(--amber-bg);
  border: 1px solid rgba(122, 88, 0, 0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--amber);
}
.notice svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* file cards */
.fg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 14px;
}
.fc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.fc:hover {
  border-color: var(--acc);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(196, 105, 58, 0.1);
}
.fc.wip {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.fct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.fnum {
  font-family: "Fira Code", monospace;
  font-size: 10px;
  color: var(--text3);
}
.lb {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}
.lb-beginner {
  background: var(--green-bg);
  color: var(--green);
}
.lb-intermediate {
  background: var(--yellow-bg);
  color: var(--yellow);
}
.lb-advanced {
  background: var(--coral-bg);
  color: var(--coral);
}
.lb-all {
  background: var(--blue-bg);
  color: var(--blue);
}
.lb-wip {
  background: var(--amber-bg);
  color: var(--amber);
}
.ftitle {
  font-family: "Fraunces", serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.fdesc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.55;
  flex: 1;
}
.ffoot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--acc);
}
.ffoot svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* search */
.sr-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sr {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.sr:hover {
  border-color: var(--acc);
}
.sr-cat {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--acc-bg);
  color: var(--acc);
  font-weight: 500;
  white-space: nowrap;
  min-width: 95px;
  text-align: center;
  flex-shrink: 0;
}
.sr-title {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
}
.sr-desc {
  font-size: 12px;
  color: var(--text3);
  margin-top: 1px;
}
.sr-arr {
  margin-left: auto;
  color: var(--text3);
  flex-shrink: 0;
}
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.empty-i {
  font-size: 32px;
  margin-bottom: 12px;
}
.empty h3 {
  font-family: "Fraunces", serif;
  font-size: 18px;
  color: var(--text2);
  margin-bottom: 6px;
}

/* mobile */
.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 90;
}
@media (max-width: 900px) {
  .topbar-stats {
    display: none;
  }
  .guide-newtab {
    display: none;
  }
  .topbar-brand {
    border-right: none;
  }
  .sidebar {
    position: fixed;
    left: -100%;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    z-index: 95;
    transition: left 0.25s;
  }
  .sidebar.open {
    left: 0;
  }
  .mob-overlay.open {
    display: block;
  }
  .mob-btn {
    display: flex !important;
  }
  .main {
    padding: 24px 20px 60px;
  }
}
@media (max-width: 480px) {
  .htitle {
    font-size: 26px;
  }
  .ccg {
    grid-template-columns: repeat(2, 1fr);
  }
  .fg {
    grid-template-columns: 1fr;
  }
  .topbar-brand {
    width: auto;
    padding: 0 12px;
  }
  .brand-name {
    font-size: 14px;
  }
  .topbar-search {
    margin: 0 8px;
  }
  .s-kbd {
    display: none;
  }
}
